View easy_broker_properties.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import unittest | |
from unittest.mock import MagicMock | |
from urllib.request import urlopen, Request | |
class EasyBrokerPropertiesResponse: | |
def easy_broker_properties_response(self): | |
api_key = os.environ["API_KEY"] |
View product.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@strawberry.federation.type(keys=["id"]) | |
class UserType: | |
id: strawberry.ID = strawberry.federation.field | |
@classmethod | |
def resolve_reference(cls, id: strawberry.ID): | |
return UserType(id) | |
@strawberry.federation.type(keys=["id"], description="User Type definition") | |
class ProductType: |
View product.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@strawberry.federation.type(keys=["id"], extend=True) | |
class UserType: | |
id: strawberry.ID = | |
@strawberry.federation.type(keys=["id"], description="User Type definition") | |
class ProductType: | |
id: strawberry.ID | |
name: str | |
@strawberry.field |
View potencial.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
def potencial(numbers: str): | |
to_split = int(len(numbers) / 2) | |
to_sum = (int(numbers[0:to_split]) + int(numbers[to_split::])) ** 2 | |
if to_sum == int(numbers): | |
return True |
View gitlab-locally.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### .gitlab-ci.yml | |
image: alpine | |
test: | |
script: | |
- echo "Hello Gitlab-Runner" | |
### Pull Gitlab Runner image | |
docker run -d \ | |
--name gitlab-runner \ |
View logs.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import reduce | |
import logging | |
logger = logging.getLogger(__name__) | |
def quote(subtotal, vat, payment_quantity): | |
### | |
logger.INFO("Create a Quote") | |
total = subtotal + (subtotal * vat) | |
### |
View test_case.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import graphene | |
import json | |
import tempfile | |
import shutil | |
from draphene.factory import PostFactory, UserFactory | |
from django.test import override_settings | |
from graphene_django.utils.testing import GraphQLTestCase | |
MEDIA_ROOT = tempfile.mkdtemp() |
View cors.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl \ | |
--verbose --request OPTIONS http://localhost:8000/graphql/ \ | |
--header 'Origin: http://localhost:3000' \ | |
--header 'Access-Control-Request-Headers: Origin, Accept, Content-Type' \ | |
--header 'Access-Control-Request-Method: POST' |
View mutation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mutation{ | |
login(username: "admin@admin.com" password: "admin"){ | |
access_token | |
} | |
} |
View user.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, NotFoundException } from '@nestjs/common'; | |
import { InjectRepository } from '@nestjs/typeorm'; | |
import { User } from './user.entity'; | |
import { Repository } from 'typeorm'; | |
import { Args } from '@nestjs/graphql'; | |
import { UsersArgs } from './dto/users.args'; | |
import { ResourceArgs } from '../common/dto/resource.args'; | |
import { UserArgs } from './dto/user.args'; | |
import { AuthArgs } from '../auth/dto/auth.args'; |
NewerOlder