From a49dfb79c94f51f860e2b76f622f59f18ad16274 Mon Sep 17 00:00:00 2001 From: Chris MacNaughton Date: Wed, 30 Jan 2019 11:50:10 +0100 Subject: [PATCH] move paths calculation out one loop --- zaza/charm_tests/security/tests.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zaza/charm_tests/security/tests.py b/zaza/charm_tests/security/tests.py index 2a414a2..a174c60 100644 --- a/zaza/charm_tests/security/tests.py +++ b/zaza/charm_tests/security/tests.py @@ -45,9 +45,12 @@ def _add_tests(): for name, attributes in files.items(): # Lets make sure to only add tests for deployed applications if name in deployed_applications: + paths = [ + file['path'] for + file in attributes['files'] + if "*" not in file["path"] + ] for file in attributes['files']: - paths = [file['path'] for file in attributes['files']] - paths = [path for path in paths if path[-1] is not "*"] test_func = _make_test_function(name, file, paths=paths) setattr( cls,