From cf89c67ac3fd2324c19af9a5e7bb08275851d9f4 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Tue, 2 Jun 2020 11:52:40 +0200 Subject: [PATCH] fix tests (lints) --- .../cis_change_service/cis_change_service/profile.py | 5 ++--- python-modules/cis_profile/cis_profile/cli.py | 6 +----- .../cis_profile_retrieval_service/tests/test_v2_api.py | 6 +++--- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/python-modules/cis_change_service/cis_change_service/profile.py b/python-modules/cis_change_service/cis_change_service/profile.py index 3a0fe4e3..d207ed4e 100644 --- a/python-modules/cis_change_service/cis_change_service/profile.py +++ b/python-modules/cis_change_service/cis_change_service/profile.py @@ -142,9 +142,8 @@ def _search_and_merge(self, user_id, cis_profile_object): ) ): logger.info( - "Will not merge user as there were no difference found with the vault instance of the user".format( - extra={"user_id": user_id} - ) + "Will not merge user as there were no difference found with the vault instance of the user", + extra={"user_id": user_id}, ) return None else: diff --git a/python-modules/cis_profile/cis_profile/cli.py b/python-modules/cis_profile/cis_profile/cli.py index 6364b247..85307f23 100644 --- a/python-modules/cis_profile/cis_profile/cli.py +++ b/python-modules/cis_profile/cis_profile/cli.py @@ -18,11 +18,7 @@ def main(): @click.command() @click.option("--seed", "-s", type=int, help="seed to create random profile", default=None) @click.option( - "--config", - "-c", - type=str, - multiple=True, - help="config options [{}]".format(", ".join(CONFIG_OPTIONS), default="default"), + "--config", "-c", type=str, multiple=True, help="config options [{}]".format(", ".join(CONFIG_OPTIONS)), ) def create(seed, config): """Create single IAM profile v2 object.""" diff --git a/python-modules/cis_profile_retrieval_service/tests/test_v2_api.py b/python-modules/cis_profile_retrieval_service/tests/test_v2_api.py index 2fd51bbd..64d80463 100644 --- a/python-modules/cis_profile_retrieval_service/tests/test_v2_api.py +++ b/python-modules/cis_profile_retrieval_service/tests/test_v2_api.py @@ -83,7 +83,7 @@ def test_returning_query_by_any_staff_only_active_true(self, fake_jwks): token = f.generate_bearer_with_scope("read:fullprofile display:all search:all") logger.info("Attempting to query all staff.") result = self.app.get( - f"/v2/users/id/all/by_attribute_contains?staff_information.staff=True&active=True", + "/v2/users/id/all/by_attribute_contains?staff_information.staff=True&active=True", headers={"Authorization": "Bearer " + token}, follow_redirects=True, ) @@ -111,7 +111,7 @@ def test_returning_query_by_any_staff_only_active_true_with_full_profiles(self, token = f.generate_bearer_with_scope("read:fullprofile display:all search:all") logger.info("Attempting to query all staff.") result = self.app.get( - f"/v2/users/id/all/by_attribute_contains?staff_information.staff=True&active=True&fullProfiles=True", + "/v2/users/id/all/by_attribute_contains?staff_information.staff=True&active=True&fullProfiles=True", headers={"Authorization": "Bearer " + token}, follow_redirects=True, ) @@ -143,7 +143,7 @@ def test_returning_query_by_any_find_ldap_members(self, fake_jwks): token = f.generate_bearer_with_scope("read:fullprofile display:all search:all") logger.info("Attempting to query all staff.") result = self.app.get( - f"/v2/users/id/all/by_attribute_contains?staff_information.staff=True&active=True&fullProfiles=True", + "/v2/users/id/all/by_attribute_contains?staff_information.staff=True&active=True&fullProfiles=True", headers={"Authorization": "Bearer " + token}, follow_redirects=True, )