Fix tests to use data_dir setting instead of downloads_dir

This commit is contained in:
Micah Lee 2019-01-20 12:01:51 -08:00
parent 6e3b103ef5
commit 53ec2176c1
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
5 changed files with 29 additions and 31 deletions

View File

@ -39,7 +39,7 @@ class GuiBaseTest(object):
strings.load_strings(common)
# Get all of the settings in test_settings
test_settings['downloads_dir'] = '/tmp/OnionShare'
test_settings['data_dir'] = '/tmp/OnionShare'
for key, val in common.settings.default_settings.items():
if key not in test_settings:
test_settings[key] = val
@ -319,5 +319,3 @@ class GuiBaseTest(object):
self.windowTitle_seen()
self.settings_button_is_visible()
self.server_status_bar_is_visible()

View File

@ -21,7 +21,7 @@ class GuiReceiveTest(GuiBaseTest):
for i in range(10):
date_dir = now.strftime("%Y-%m-%d")
time_dir = now.strftime("%H.%M.%S")
receive_mode_dir = os.path.join(self.gui.common.settings.get('downloads_dir'), date_dir, time_dir)
receive_mode_dir = os.path.join(self.gui.common.settings.get('data_dir'), date_dir, time_dir)
expected_filename = os.path.join(receive_mode_dir, expected_basename)
if os.path.exists(expected_filename):
exists = True

View File

@ -148,7 +148,7 @@ class SettingsGuiBaseTest(object):
self.assertFalse(self.gui.close_after_first_download_checkbox.isChecked())
# receive mode
self.gui.downloads_dir_lineedit.setText('/tmp/OnionShareSettingsTest')
self.gui.data_dir_lineedit.setText('/tmp/OnionShareSettingsTest')
# bundled mode is enabled
@ -234,7 +234,7 @@ class SettingsGuiBaseTest(object):
self.assertFalse(data["save_private_key"])
self.assertFalse(data["use_stealth"])
self.assertEqual(data["downloads_dir"], "/tmp/OnionShareSettingsTest")
self.assertEqual(data["data_dir"], "/tmp/OnionShareSettingsTest")
self.assertFalse(data["close_after_first_download"])
self.assertEqual(data["connection_type"], "bundled")
self.assertFalse(data["tor_bridges_use_obfs4"])

View File

@ -39,7 +39,7 @@ class TorGuiBaseTest(GuiBaseTest):
# Get all of the settings in test_settings
test_settings['connection_type'] = 'automatic'
test_settings['downloads_dir'] = '/tmp/OnionShare'
test_settings['data_dir'] = '/tmp/OnionShare'
for key, val in common.settings.default_settings.items():
if key not in test_settings:
test_settings[key] = val

View File

@ -64,7 +64,7 @@ class TestSettings:
'private_key': '',
'slug': '',
'hidservauth_string': '',
'downloads_dir': os.path.expanduser('~/OnionShare'),
'data_dir': os.path.expanduser('~/OnionShare'),
'public_mode': False
}
for key in settings_obj._settings: