From: Douglas Bagnall Date: Wed, 15 Jun 2022 01:22:24 +0000 (+1200) Subject: pytest/samdb: use TestCaseInTempDir.rm_files/.rm_dirs X-Git-Tag: talloc-2.4.0~1201 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=251360d6e58986dd53f0317319544e930dc61444;p=thirdparty%2Fsamba.git pytest/samdb: use TestCaseInTempDir.rm_files/.rm_dirs Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power --- diff --git a/python/samba/tests/samdb.py b/python/samba/tests/samdb.py index 834c5a204a6..f7697f83fdc 100644 --- a/python/samba/tests/samdb.py +++ b/python/samba/tests/samdb.py @@ -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()