diff options
Diffstat (limited to 'cli/tests/test_cli_web.py')
-rw-r--r-- | cli/tests/test_cli_web.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/tests/test_cli_web.py b/cli/tests/test_cli_web.py index ec51654c..f8c96f9c 100644 --- a/cli/tests/test_cli_web.py +++ b/cli/tests/test_cli_web.py @@ -51,6 +51,7 @@ def web_obj(temp_dir, common_obj, mode, num_files=0): web.generate_password() web.running = True + web.cleanup_filenames == [] web.app.testing = True # Share mode @@ -345,6 +346,16 @@ class TestWeb: res.get_data() assert res.status_code == 200 + def test_cleanup(self, common_obj, temp_dir_1024, temp_file_1024): + web = web_obj(temp_dir_1024, common_obj, "share", 3) + + web.cleanup_filenames = [temp_dir_1024, temp_file_1024] + web.cleanup() + + assert os.path.exists(temp_file_1024) is False + assert os.path.exists(temp_dir_1024) is False + assert web.cleanup_filenames == [] + def _make_auth_headers(self, password): auth = base64.b64encode(b"onionshare:" + password.encode()).decode() h = Headers() |