diff options
author | Christian Heimes <christian@python.org> | 2015-07-08 11:12:25 +0200 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2015-07-08 06:25:06 -0400 |
commit | 3b135033f4d70c59a9b6880c13b38238ff593081 (patch) | |
tree | c8588fbd4d9abfd41ec7fafe7e5230612fb15f09 /tests | |
parent | c4e6d1ffdd348b7a78ea7da6f8af774c4ce0b3c4 (diff) | |
download | custodia-3b135033f4d70c59a9b6880c13b38238ff593081.tar.gz custodia-3b135033f4d70c59a9b6880c13b38238ff593081.tar.xz custodia-3b135033f4d70c59a9b6880c13b38238ff593081.zip |
Fix typos in tests and add cleanup
The patch fixes to typos in the tear down function of two test suites.
The tests now cleanup and remove temporary files like Unix socket and
test databases.
Reviewed-by: Simo Sorce <simo@redhat.com>
Closes: #3
Diffstat (limited to 'tests')
-rw-r--r-- | tests/custodia.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/custodia.py b/tests/custodia.py index 9117d5e..754c1b3 100644 --- a/tests/custodia.py +++ b/tests/custodia.py @@ -26,8 +26,16 @@ class CustodiaTests(unittest.TestCase): 'Content-Type': 'application/json'} @classmethod - def AtearDownClass(self): - os.killpg(self.custodia_process.pid, signal.SIGTERM) + def tearDownClass(self): + try: + os.killpg(self.custodia_process.pid, signal.SIGTERM) + except OSError: + pass + for fname in ['server_socket', 'secrets.db']: + try: + os.unlink(fname) + except OSError: + pass def _make_request(self, cmd, path, headers=None, body=None): conn = LocalConnection('./server_socket') |