Skip to content

Commit

Permalink
fix: Run black and adjust flake8 requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandro-Meireles committed Aug 23, 2023
1 parent 27699b1 commit d0bdf4d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
1 change: 0 additions & 1 deletion marketplace/event_driven/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class EDAConsumer(ABC):

def handle(self, message: amqp.Message):
message_started.send(sender=self)
try:
Expand Down
12 changes: 8 additions & 4 deletions marketplace/projects/consumers/project_consumer.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import amqp
from sentry_sdk import capture_exception

from ..usecases import TemplateTypeIntegrationUseCase, ProjectCreationUseCase, AppSetupHandlerUseCase, ProjectCreationDTO
from ..usecases.exceptions import InvalidProjectData, InvalidTemplateTypeData
from ..usecases import (
TemplateTypeIntegrationUseCase,
ProjectCreationUseCase,
AppSetupHandlerUseCase,
ProjectCreationDTO,
)
from marketplace.connect.client import ConnectProjectClient, WPPRouterChannelClient
from marketplace.event_driven.parsers import JSONParser, ParseError
from marketplace.event_driven.parsers import JSONParser
from marketplace.event_driven.consumers import EDAConsumer


class ProjectConsumer(EDAConsumer):
class ProjectConsumer(EDAConsumer): # pragma: no cover
def consume(self, message: amqp.Message):
print(f"[ProjectConsumer] - Consuming a message. Body: {message.body}")

Expand Down
2 changes: 1 addition & 1 deletion marketplace/projects/consumers/template_type_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from ..usecases import create_template_type


class TemplateTypeConsumer(EDAConsumer):
class TemplateTypeConsumer(EDAConsumer): # pragma: no cover
def consume(self, message: amqp.Message):
body = JSONParser.parse(message.body)

Expand Down
1 change: 1 addition & 0 deletions marketplace/projects/usecases/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class InvalidProjectData(Exception):
pass


class InvalidTemplateTypeData(Exception):
pass
4 changes: 2 additions & 2 deletions marketplace/projects/usecases/interfaces.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING

if TYPE_CHECKING:
if TYPE_CHECKING: # pragma: no cover
from django.contrib.auth import get_user_model

from ..models import Project

User = get_user_model()


class TemplateTypeIntegrationInterface(ABC):
class TemplateTypeIntegrationInterface(ABC): # pragma: no cover
@abstractmethod
def integrate_template_type_in_project(self, project: "Project", template_type_uuid: str, user: "User"):
pass
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def setUp(self) -> None:
def test_get_user_by_email_raises_invalid_project_data(self):
usecase = ProjectCreationUseCase(self.template_type_integration)

with self.assertRaisesMessage(InvalidProjectData, f"User with email `fake@email.com` does not exist!"):
with self.assertRaisesMessage(InvalidProjectData, "User with email `fake@email.com` does not exist!"):
usecase.get_user_by_email("fake@email.com")

def test_get_user_by_email(self):
Expand Down

0 comments on commit d0bdf4d

Please sign in to comment.