Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
anikaweinmann committed Dec 12, 2024
1 parent 5f61b84 commit 45c96fa
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python
"""
Copyright (c) 2024 mundialis GmbH & Co. KG.
"""Copyright (c) 2024 mundialis GmbH & Co. KG.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
5 changes: 3 additions & 2 deletions src/actinia_example_plugin/apidocs/helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
__maintainer__ = "mundialis GmbH & Co. KG"


from actinia_example_plugin.model.response_models import \
SimpleStatusCodeResponseModel
from actinia_example_plugin.model.response_models import (
SimpleStatusCodeResponseModel,
)

describe_hello_world_get_docs = {
# "summary" is taken from the description of the get method
Expand Down
5 changes: 3 additions & 2 deletions src/actinia_example_plugin/apidocs/project_helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
__maintainer__ = "mundialis GmbH & Co. KG"


from actinia_example_plugin.model.response_models import \
SimpleStatusCodeResponseModel
from actinia_example_plugin.model.response_models import (
SimpleStatusCodeResponseModel,
)

describe_project_hello_world_get_docs = {
# "summary" is taken from the description of the get method
Expand Down
12 changes: 5 additions & 7 deletions tests/test_resource_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python
"""
Copyright (c) 2016-2022 mundialis GmbH & Co. KG
"""Copyright (c) 2016-2022 mundialis GmbH & Co. KG
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -24,12 +23,11 @@
import signal
import time

from werkzeug.datastructures import Headers

from actinia_core.testsuite import ActiniaTestCaseBase, URL_PREFIX
from actinia_core.core.common.user import ActiniaUser
from actinia_core.core.common.config import global_config
from actinia_core.core.common.user import ActiniaUser
from actinia_core.endpoints import create_endpoints
from actinia_core.testsuite import ActiniaTestCaseBase
from werkzeug.datastructures import Headers


__license__ = "GPLv3"
Expand Down Expand Up @@ -124,7 +122,7 @@ def create_user(
# We need to create an HTML basic authorization header
cls.auth_header[role] = Headers()
cls.auth_header[role].add(
"Authorization", "Basic " + base64.b64encode(auth).decode()
"Authorization", f"Basic {base64.b64encode(auth).decode()}",
)

# Make sure the user database is empty
Expand Down
7 changes: 3 additions & 4 deletions tests/testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,14 @@

class ActiniaTestCase(unittest.TestCase):
"""Actinia test case class."""

# guest = None
# admin = None
# superadmin = None
user = None
auth_header = {}
users_list = []

def setUp(self):
def setUp(self) -> None:
"""Overwrites method setUp from unittest.TestCase class."""

self.app_context = flask_app.app_context()
Expand Down Expand Up @@ -74,7 +73,7 @@ def setUp(self):

# create test user for roles user (more to come)
accessible_datasets = {
"nc_spm_08": ["PERMANENT", "user1", "modis_lst"]
"nc_spm_08": ["PERMANENT", "user1", "modis_lst"],
}
password = pwgen.pwgen()
(
Expand Down Expand Up @@ -120,7 +119,7 @@ def setUp(self):
# create_process_queue
# create_process_queue(config=global_config)

def tearDown(self):
def tearDown(self) -> None:
"""Overwrites method tearDown from unittest.TestCase class."""

self.app_context.pop()
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/test_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"inp,ref_out",
[("test", "Hello world TEST!"), ("bla23", "Hello world BLA23!")],
)
def test_transform_input(inp, ref_out):
def test_transform_input(inp, ref_out) -> None:
"""Test for tranform_input function."""
out = transform_input(inp)
assert out == ref_out, f"Wrong result from transform_input for {inp}"

0 comments on commit 45c96fa

Please sign in to comment.