[tests] when calling Client.shutdown(), SystemSettings plugins are not removed now, so tests require to call destroy() first, then shutdown()

This commit is contained in:
Fabio Erculiani
2010-09-25 12:05:57 +02:00
parent 3c6f504e45
commit a55ada4fca
6 changed files with 32 additions and 0 deletions
+5
View File
@@ -42,6 +42,11 @@ class EntropyRepositoryTest(unittest.TestCase):
"""
sys.stdout.write("%s ran\n" % (self,))
sys.stdout.flush()
# calling destroy() and shutdown()
# need to call destroy() directly to remove all the SystemSettings
# plugins because shutdown() doesn't, since it's meant to be called
# right before terminating the process
self.Client.destroy()
self.Client.shutdown()
def test_another_instance(self):
+5
View File
@@ -43,6 +43,11 @@ class EntropyRepositoryTest(unittest.TestCase):
sys.stdout.flush()
self.test_db.close()
self.test_db2.close()
# calling destroy() and shutdown()
# need to call destroy() directly to remove all the SystemSettings
# plugins because shutdown() doesn't, since it's meant to be called
# right before terminating the process
self.Client.destroy()
self.Client.shutdown()
def __open_test_db(self, tmp_path):
+5
View File
@@ -39,6 +39,11 @@ class SecurityTest(unittest.TestCase):
"""
tearDown is run after each test
"""
# calling destroy() and shutdown()
# need to call destroy() directly to remove all the SystemSettings
# plugins because shutdown() doesn't, since it's meant to be called
# right before terminating the process
self._entropy.destroy()
self._entropy.shutdown()
del self._entropy
del self._repository
+5
View File
@@ -36,6 +36,11 @@ class EntropyRepositoryTest(unittest.TestCase):
"""
sys.stdout.write("%s ran\n" % (self,))
sys.stdout.flush()
# calling destroy() and shutdown()
# need to call destroy() directly to remove all the SystemSettings
# plugins because shutdown() doesn't, since it's meant to be called
# right before terminating the process
self.Server.destroy()
self.Server.shutdown()
def test_server_instance(self):
+5
View File
@@ -28,6 +28,11 @@ class SpmTest(unittest.TestCase):
"""
sys.stdout.write("%s ran\n" % (self,))
sys.stdout.flush()
# calling destroy() and shutdown()
# need to call destroy() directly to remove all the SystemSettings
# plugins because shutdown() doesn't, since it's meant to be called
# right before terminating the process
self.Client.destroy()
self.Client.shutdown()
def test_init(self):
+7
View File
@@ -49,6 +49,13 @@ class ToolsTest(unittest.TestCase):
os.close(fd)
os.remove(tmp_path)
# calling destroy() and shutdown()
# need to call destroy() directly to remove all the SystemSettings
# plugins because shutdown() doesn't, since it's meant to be called
# right before terminating the process
client.destroy()
client.shutdown()
def test_remove_entropy_metadata(self):