]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pytest: sddl tests can be only externally defined
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 6 Sep 2023 23:19:21 +0000 (11:19 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 26 Sep 2023 23:45:35 +0000 (23:45 +0000)
Currently a test suite needs a strings list in order to import new
strings. This lets us avoid that and have the actual tests defined
only in external lists, making it easier to see we're testing the same
thing on Windows and reducing duplication.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/sddl.py

index da755904a77e0a58db4fbf71d3e518f0f145d51c..8cc3ac9844c3e1509276b481646d59e53d0b55a6 100644 (file)
@@ -149,6 +149,9 @@ class SddlDecodeEncodeBase(TestCase):
         """
         filename = f"{dir}/{cls.name}.txt"
 
+        if not hasattr(cls, 'strings'):
+            cls.strings = []
+
         old_pairs = set()
         for s in cls.strings:
             if isinstance(s, str):