From fe31bb02ab0f6c8cb1c82d5d9b3f0d478753e8c5 Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Fri, 27 Mar 2020 09:01:47 +0100 Subject: [PATCH] changes after linting --- superx_budget/helpers.py | 4 +--- superx_budget/pyramid/__init__.py | 2 +- superx_budget/pyramid/security.py | 10 +++------- tests/test_superx_parser.py | 14 ++------------ 4 files changed, 7 insertions(+), 23 deletions(-) diff --git a/superx_budget/helpers.py b/superx_budget/helpers.py index 34c167e..07d5c24 100644 --- a/superx_budget/helpers.py +++ b/superx_budget/helpers.py @@ -4,9 +4,7 @@ from pathlib import Path import openpyxl -DEFAULT_RECIPIENTS = [ - "frey@imtek.de", -] +DEFAULT_RECIPIENTS = ["frey@imtek.de"] def excel_value_as_number(value): diff --git a/superx_budget/pyramid/__init__.py b/superx_budget/pyramid/__init__.py index a9d86b9..635ee15 100644 --- a/superx_budget/pyramid/__init__.py +++ b/superx_budget/pyramid/__init__.py @@ -34,7 +34,7 @@ def main(global_config, **settings): config.set_root_factory(Root) config.add_request_method( - lambda r: Path(settings["budgets.dir"]), "budgets_dir", reify=True, + lambda r: Path(settings["budgets.dir"]), "budgets_dir", reify=True ) age = int(settings.get("static_views.cache_max_age", 0)) diff --git a/superx_budget/pyramid/security.py b/superx_budget/pyramid/security.py index c969f81..6d2c640 100644 --- a/superx_budget/pyramid/security.py +++ b/superx_budget/pyramid/security.py @@ -21,9 +21,7 @@ def get_user(request): return request.unauthenticated_userid -@forbidden_view_config( - renderer="superx_budget:pyramid/templates/login.jinja2", -) +@forbidden_view_config(renderer="superx_budget:pyramid/templates/login.jinja2") def forbidden_view(request): return {"error": False} @@ -42,9 +40,7 @@ def login(request): return {"error": True} -@view_config( - context=Root, name="logout", permission="login", -) +@view_config(context=Root, name="logout", permission="login") def logout(request): headers = forget(request) return HTTPFound("/", headers=headers) @@ -53,7 +49,7 @@ def logout(request): def includeme(config): settings = config.get_settings() authn_policy = MyAuthenticationPolicy( - settings["auth.secret"], hashalg="sha512", + settings["auth.secret"], hashalg="sha512" ) config.set_authentication_policy(authn_policy) config.set_authorization_policy(ACLAuthorizationPolicy()) diff --git a/tests/test_superx_parser.py b/tests/test_superx_parser.py index 3561a02..55cafbe 100644 --- a/tests/test_superx_parser.py +++ b/tests/test_superx_parser.py @@ -51,12 +51,7 @@ def test_get_export_metadata_raises_error(faulty_data): def test_skip_export_data_until_table_header_ok(): from superx_budget.superx import _skip_export_data_until_table_header - rows = [ - [""], - [""], - ["Kostenstelle"], - ["Daten"], - ] + rows = [[""], [""], ["Kostenstelle"], ["Daten"]] iterator = iter(rows) _skip_export_data_until_table_header(iterator) data_line = next(iterator) @@ -68,12 +63,7 @@ def test_skip_export_data_until_table_header_raises_error(): from superx_budget.superx import _skip_export_data_until_table_header from superx_budget.exceptions import SuperXParserError - rows = [ - [""], - [""], - ["Keine Kostenstelle"], - ["Daten"], - ] + rows = [[""], [""], ["Keine Kostenstelle"], ["Daten"]] iterator = iter(rows) with pytest.raises(SuperXParserError): _skip_export_data_until_table_header(iterator)