]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pytest/samdb: use TestCaseInTempDir.rm_files/.rm_dirs
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 15 Jun 2022 01:22:24 +0000 (13:22 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Tue, 6 Sep 2022 21:12:36 +0000 (21:12 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
python/samba/tests/samdb.py

index 834c5a204a6c1382d2ce7380a65f3d68d6ffaa4b..f7697f83fdc75eec7bbd495fa0d55591fc1926e0 100644 (file)
@@ -19,7 +19,6 @@
 
 import logging
 import os
-import shutil
 
 from samba.auth import system_session
 from samba.provision import provision
@@ -54,11 +53,8 @@ class SamDBTestCase(TestCaseInTempDir):
         self.lp = self.result.lp
 
     def tearDown(self):
-        for f in ['names.tdb']:
-            os.remove(os.path.join(self.tempdir, f))
-
-        for d in ['etc', 'msg.lock', 'private', 'state', 'bind-dns']:
-            shutil.rmtree(os.path.join(self.tempdir, d))
+        self.rm_files('names.tdb')
+        self.rm_dirs('etc', 'msg.lock', 'private', 'state', 'bind-dns')
 
         super(SamDBTestCase, self).tearDown()