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
class TestPaymentCommandService(unittest.IsolatedAsyncioTestCase): | |
def setUp(self) -> None: | |
self.injector = build_dependency_injector() | |
async def asyncSetUp(self) -> None: | |
await self.injector.wire(modules=[sys.modules[__name__]]) | |
async def asyncTearDown(self) -> None: | |
await self.injector.unwire() |
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
poetry add faker --dev |
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
class PaymentCommandService(CommandService): | |
"""PaymentCommandService class.""" | |
def validate_card(self, card_number: str) -> bool: | |
def digits_of(n): | |
return [int(d) for d in str(n)] | |
digits = digits_of(card_number) | |
odd_digits = digits[-1::-2] | |
even_digits = digits[-2::-2] |
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 sys | |
import unittest | |
from src import ( | |
Notifier, | |
NotifierCommandService, | |
) | |
from minos.networks import ( | |
InMemoryRequest, |
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 smtplib | |
import ssl | |
from email.mime.multipart import ( | |
MIMEMultipart, | |
) | |
from email.mime.text import ( | |
MIMEText, | |
) | |
from minos.cqrs import ( |
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 sys | |
import unittest | |
from src import ( | |
Currency, | |
CurrencyCommandService, | |
) | |
from minos.networks import ( | |
InMemoryRequest, |
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 minos.cqrs import ( | |
CommandService, | |
) | |
from minos.networks import ( | |
Request, | |
Response, | |
ResponseException, | |
enroute, | |
) | |
import os.path as op |
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
poetry add CurrencyConverter |
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 sys | |
import unittest | |
from src import ( | |
ShippingCommandService, | |
) | |
from minos.networks import ( | |
InMemoryRequest, | |
Response, |
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 haversine as haversine | |
from geopy.geocoders import ( | |
Nominatim, | |
) | |
from minos.cqrs import ( | |
CommandService, | |
) | |
from minos.networks import ( | |
Request, |
NewerOlder