From 54970d23f277160a4951c50dc78755bae700beee Mon Sep 17 00:00:00 2001 From: Justus Schock Date: Thu, 17 Oct 2019 15:02:36 +0200 Subject: [PATCH 1/2] Rewrite tests to reflect actual (and expected) behaviour of config when returning multiple values --- tests/utils/test_config.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/utils/test_config.py b/tests/utils/test_config.py index a8a115f6..580953fc 100644 --- a/tests/utils/test_config.py +++ b/tests/utils/test_config.py @@ -245,8 +245,15 @@ def test_nested_lookpup(self): cf.nested_get("deep") multiple_val = cf.nested_get("deep", allow_multiple=True) - self.assertEqual(multiple_val, [{"deepStr": "b", "deepNum": 2}, - "duplicate"]) + + expected_result = [{"deepStr": "b", "deepNum": 2}, + "duplicate"] + + for val in multiple_val: + self.assertIn(val, expected_result) + expected_result.pop(expected_result.index(val)) + + self.assertEquals(len(expected_result), 0) class DeliraConfigTest(LookupConfigTest): @@ -311,7 +318,7 @@ def test_logging_as_string(self): " __type__:\n" " module: delira.utils.config\n" " name: LookupConfig\n".format( - cf["_timestamp"]))) + cf["_timestamp"]))) self.assertEqual(cf_str_full, ("__convert__:\n" @@ -327,7 +334,7 @@ def test_logging_as_string(self): " __type__:\n" " module: delira.utils.config\n" " name: DeliraConfig\n".format( - cf["_timestamp"], cf["_version"]))) + cf["_timestamp"], cf["_version"]))) @unittest.skipUnless( check_for_no_backend(), From f61812c25d19693972a14a90c7660e8caf41d5f6 Mon Sep 17 00:00:00 2001 From: Travis AutoPEP8 Fixes Date: Thu, 17 Oct 2019 13:37:06 +0000 Subject: [PATCH 2/2] PEP-8 Auto-Fix --- tests/utils/test_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/utils/test_config.py b/tests/utils/test_config.py index 580953fc..895a7999 100644 --- a/tests/utils/test_config.py +++ b/tests/utils/test_config.py @@ -318,7 +318,7 @@ def test_logging_as_string(self): " __type__:\n" " module: delira.utils.config\n" " name: LookupConfig\n".format( - cf["_timestamp"]))) + cf["_timestamp"]))) self.assertEqual(cf_str_full, ("__convert__:\n" @@ -334,7 +334,7 @@ def test_logging_as_string(self): " __type__:\n" " module: delira.utils.config\n" " name: DeliraConfig\n".format( - cf["_timestamp"], cf["_version"]))) + cf["_timestamp"], cf["_version"]))) @unittest.skipUnless( check_for_no_backend(),