From a55ada4fcaf1f0d9bc89ded0d72dc658333d187f Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 25 Sep 2010 12:05:57 +0200 Subject: [PATCH] [tests] when calling Client.shutdown(), SystemSettings plugins are not removed now, so tests require to call destroy() first, then shutdown() --- libraries/tests/client.py | 5 +++++ libraries/tests/db.py | 5 +++++ libraries/tests/security.py | 5 +++++ libraries/tests/server.py | 5 +++++ libraries/tests/spm.py | 5 +++++ libraries/tests/tools.py | 7 +++++++ 6 files changed, 32 insertions(+) diff --git a/libraries/tests/client.py b/libraries/tests/client.py index 0fb3a2a63..2bf19beb6 100644 --- a/libraries/tests/client.py +++ b/libraries/tests/client.py @@ -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): diff --git a/libraries/tests/db.py b/libraries/tests/db.py index 4980a69c6..bedfb0763 100644 --- a/libraries/tests/db.py +++ b/libraries/tests/db.py @@ -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): diff --git a/libraries/tests/security.py b/libraries/tests/security.py index 31370d0aa..3b51ded71 100644 --- a/libraries/tests/security.py +++ b/libraries/tests/security.py @@ -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 diff --git a/libraries/tests/server.py b/libraries/tests/server.py index 465b5373e..80793b42a 100644 --- a/libraries/tests/server.py +++ b/libraries/tests/server.py @@ -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): diff --git a/libraries/tests/spm.py b/libraries/tests/spm.py index b1e377c9e..eecfd7bb7 100644 --- a/libraries/tests/spm.py +++ b/libraries/tests/spm.py @@ -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): diff --git a/libraries/tests/tools.py b/libraries/tests/tools.py index 8c18b271c..de7bcdf71 100644 --- a/libraries/tests/tools.py +++ b/libraries/tests/tools.py @@ -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):