Fix CLI tests

This commit is contained in:
Micah Lee 2021-12-01 21:01:32 -08:00
parent c8ba508d26
commit b3d53ca2f2
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
4 changed files with 46 additions and 32 deletions

View file

@ -54,7 +54,7 @@ class TestSettings:
"socks_port": 9999,
"use_stealth": True,
}
tmp_file, tmp_file_path = tempfile.mkstemp(dir=temp_dir)
tmp_file, tmp_file_path = tempfile.mkstemp(dir=temp_dir.name)
with open(tmp_file, "w") as f:
json.dump(custom_settings, f)
settings_obj.filename = tmp_file_path
@ -69,7 +69,7 @@ class TestSettings:
def test_save(self, monkeypatch, temp_dir, settings_obj):
settings_filename = "default_settings.json"
new_temp_dir = tempfile.mkdtemp(dir=temp_dir)
new_temp_dir = tempfile.mkdtemp(dir=temp_dir.name)
settings_path = os.path.join(new_temp_dir, settings_filename)
settings_obj.filename = settings_path
settings_obj.save()