Skip to content

Commit

Permalink
Merge pull request #4 from Lundalogik/lime-generate
Browse files Browse the repository at this point in the history
feat: run flake8, isort and black
  • Loading branch information
lindamyhrman authored Oct 1, 2024
2 parents 7ad2a10 + d3220b8 commit b52057e
Show file tree
Hide file tree
Showing 17 changed files with 14 additions and 36 deletions.
31 changes: 12 additions & 19 deletions solution_charge_amps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,53 +18,46 @@ def default_config():
try:
from .endpoints import register_blueprint # noqa
except ImportError:
logger.info('solution_charge_amps doesn\'t implement any custom '
'endpoints')
logger.info("solution_charge_amps doesn't implement any custom " "endpoints")

try:
from .event_handlers import register_event_handlers # noqa
except ImportError:
logger.info('solution_charge_amps doesn\'t implement any event '
'handlers')
logger.info("solution_charge_amps doesn't implement any event " "handlers")

try:
from .limeobject_classes import register_limeobject_classes # noqa
except ImportError:
logger.info('solution_charge_amps doesn\'t implement any '
'limeobject classes')
logger.info("solution_charge_amps doesn't implement any " "limeobject classes")

try:
from .web_components import register_web_components # noqa
except ImportError:
logger.info('solution_charge_amps doesn\'t implement any '
'web-components')
logger.info("solution_charge_amps doesn't implement any " "web-components")

try:
from .translations import register_translations # noqa
except ImportError:
logger.info('solution_charge_amps doesn\'t contain any '
'translations')
logger.info("solution_charge_amps doesn't contain any " "translations")

try:
from .config import register_config # noqa
except ImportError:
logger.info('solution_charge_amps doesn\'t contain any config')
logger.info("solution_charge_amps doesn't contain any config")

try:
from .tasks import get_task_modules # noqa
except ImportError:
logger.info('solution_charge_amps doesn\'t implement any '
'async tasks')
logger.info("solution_charge_amps doesn't implement any " "async tasks")

try:
from .tasks import register_scheduled_tasks # noqa
except ImportError:
logger.info('solution_charge_amps doesn\'t contain any '
'scheduled tasks')
logger.info("solution_charge_amps doesn't contain any " "scheduled tasks")


def register_static_content():
'''
"""
Returns a list with tuples:
(route, path_to_static_content).
Expand All @@ -79,12 +72,12 @@ def register_static_content():
add the function `register_static_content` to the module. The function
takes no arguments and shall return a list with tuples in the same form as
this function.
'''
"""
static_filepaths = []
try:
from .web_components import register_static_content as wc_reg_static

static_filepaths += wc_reg_static()
except ImportError:
logger.info('solution_charge_amps doesn\'t contain any'
'static content')
logger.info("solution_charge_amps doesn't contain any" "static content")
return static_filepaths
1 change: 0 additions & 1 deletion solution_charge_amps/limeobject_classes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ def create_automated_flow_participant_history(
attach_active_coworker=True,
auto_relate=False,
)

1 change: 0 additions & 1 deletion solution_charge_amps/limeobject_classes/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ def after_update(self, unsaved_self, **kwargs):

def register_limeobject_classes(register_class):
register_class("company", Company)

1 change: 0 additions & 1 deletion solution_charge_amps/limeobject_classes/coworker.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ def after_update(self, unsaved_self, **kwargs):

def register_limeobject_classes(register_class):
register_class("coworker", Coworker)

1 change: 0 additions & 1 deletion solution_charge_amps/limeobject_classes/deal.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,3 @@ def _get_idx(obj: LimeObject):
),
None,
)

1 change: 0 additions & 1 deletion solution_charge_amps/limeobject_classes/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ def _create_document_history(document: Document, uow: UnitOfWork):
attach_active_coworker=True,
auto_relate=False,
)

1 change: 0 additions & 1 deletion solution_charge_amps/limeobject_classes/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,3 @@ def _handle_sales_contact_on_object(parent_object: LimeObject):
_handle_sales_contact_on_object(prev_parent_object)
except lime_errors.NotFoundError:
pass # Ignore if the previous object is not found

1 change: 0 additions & 1 deletion solution_charge_amps/limeobject_classes/lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,3 @@ def _create_automated_flow_participant(
uow.add(affected_object)

return participant

1 change: 0 additions & 1 deletion solution_charge_amps/limeobject_classes/person.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ def after_update(self, unsaved_self, **kwargs):

def register_limeobject_classes(register_class):
register_class("person", Person)

1 change: 0 additions & 1 deletion solution_charge_amps/limeobject_classes/todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ def after_update(self, unsaved_self, **kwargs):

def register_limeobject_classes(register_class):
register_class("todo", Todo)

1 change: 0 additions & 1 deletion tests/custom_dsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,4 +940,3 @@
bw_nextstep_time:
type: time
"""

1 change: 0 additions & 1 deletion tests/lime_sales/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ def lime_app(lime_app) -> LimeApplication:
@pytest.fixture
def loaded_plugins(no_registered_limeobjects):
return lime_plugins.load_plugins(config=lime_config.config)

Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ def test_expecteddate_when_setting_status_to_closed_status(
deal = next(iter(save_lime_objects(deal)))

assert deal.properties.expecteddate.value

Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ def test_create_autolog_history_when_new(
assert history.properties.coworker.value == lime_app.coworker.id
except StopIteration:
assert False, "history should be in the uow"

Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,3 @@ def test_latestsalescontact_is_set_when_salescontact_history_is_attached(
company.properties.latestsalescontact.value.astimezone(pytz.UTC).isoformat()
== test_date.isoformat()
)

Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,3 @@ def test_trigger_automatedflow(

except StopIteration:
assert False, "The lead should have a automatedflowparticipant related"

4 changes: 2 additions & 2 deletions tests/test_insanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


def test_insanity():
_lime = 'Lime CRM'
assert _lime == 'Lime CRM'
_lime = "Lime CRM"
assert _lime == "Lime CRM"

0 comments on commit b52057e

Please sign in to comment.