diff --git a/tests2/gui_base_test.py b/tests2/gui_base_test.py index d7b5a438..aaab7b80 100644 --- a/tests2/gui_base_test.py +++ b/tests2/gui_base_test.py @@ -50,6 +50,11 @@ class GuiBaseTest(unittest.TestCase): with open(cls.tmpfile_test, "w") as file: file.write("onionshare") + # A file called "test2.txt" + cls.tmpfile_test2 = os.path.join(cls.tmpdir.name, "test2.txt") + with open(cls.tmpfile_test2, "w") as file: + file.write("onionshare2") + # A large file size = 1024 * 1024 * 155 cls.tmpfile_large = os.path.join(cls.tmpdir.name, "large_file") diff --git a/tests2/test_gui_receive.py b/tests2/test_gui_receive.py index 13358086..026de6f7 100644 --- a/tests2/test_gui_receive.py +++ b/tests2/test_gui_receive.py @@ -121,15 +121,15 @@ class TestReceive(GuiBaseTest): self.counter_incremented(tab, 1) self.upload_file(tab, self.tmpfile_test, "test.txt") self.counter_incremented(tab, 2) - self.upload_file(tab, "/tmp/testdir/test", "test") + self.upload_file(tab, self.tmpfile_test2, "test2.txt") self.counter_incremented(tab, 3) - self.upload_file(tab, "/tmp/testdir/test", "test") + self.upload_file(tab, self.tmpfile_test2, "test2.txt") self.counter_incremented(tab, 4) # Test uploading the same file twice at the same time, and make sure no collisions self.upload_file(tab, self.tmpfile_test, "test.txt", True) self.counter_incremented(tab, 6) self.history_indicator(tab, "2") - self.server_is_stopped(tab, False) + self.server_is_stopped(tab) self.web_server_is_stopped(tab) self.server_status_indicator_says_closed(tab) self.server_working_on_start_button_pressed(tab) @@ -186,3 +186,15 @@ class TestReceive(GuiBaseTest): self.web_server_is_stopped(tab) self.close_all_tabs() + + @pytest.mark.gui + def test_upload(self): + """ + Test uploading files + """ + tab = self.new_receive_tab() + + self.run_all_common_setup_tests() + self.run_all_receive_mode_tests(tab) + + self.close_all_tabs()