mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-16 13:22:28 -04:00
Refactor CommonTests to pass in actual Mode objects, and fix all tests. Now all ShareMode tests pass
This commit is contained in:
parent
1b1ade63da
commit
4d217e8403
7 changed files with 97 additions and 113 deletions
|
@ -96,27 +96,27 @@ class OnionShareGuiTest(unittest.TestCase):
|
|||
|
||||
@pytest.mark.run(order=6)
|
||||
def test_click_mode(self):
|
||||
CommonTests.test_click_mode(self, 'receive')
|
||||
CommonTests.test_click_mode(self, self.gui.receive_mode)
|
||||
|
||||
@pytest.mark.run(order=6)
|
||||
def test_history_is_not_visible(self):
|
||||
CommonTests.test_history_is_not_visible(self, 'receive')
|
||||
CommonTests.test_history_is_not_visible(self, self.gui.receive_mode)
|
||||
|
||||
@pytest.mark.run(order=7)
|
||||
def test_click_toggle_history(self):
|
||||
CommonTests.test_click_toggle_history(self, 'receive')
|
||||
CommonTests.test_click_toggle_history(self, self.gui.receive_mode)
|
||||
|
||||
@pytest.mark.run(order=8)
|
||||
def test_history_is_visible(self):
|
||||
CommonTests.test_history_is_visible(self, 'receive')
|
||||
CommonTests.test_history_is_visible(self, self.gui.receive_mode)
|
||||
|
||||
@pytest.mark.run(order=8)
|
||||
def test_server_working_on_start_button_pressed(self):
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, 'receive')
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, self.gui.receive_mode)
|
||||
|
||||
@pytest.mark.run(order=9)
|
||||
def test_server_status_indicator_says_starting(self):
|
||||
CommonTests.test_server_status_indicator_says_starting(self, 'receive')
|
||||
CommonTests.test_server_status_indicator_says_starting(self, self.gui.receive_mode)
|
||||
|
||||
@pytest.mark.run(order=10)
|
||||
def test_settings_button_is_hidden(self):
|
||||
|
@ -124,7 +124,7 @@ class OnionShareGuiTest(unittest.TestCase):
|
|||
|
||||
@pytest.mark.run(order=11)
|
||||
def test_a_server_is_started(self):
|
||||
CommonTests.test_a_server_is_started(self, 'receive')
|
||||
CommonTests.test_a_server_is_started(self, self.gui.receive_mode)
|
||||
|
||||
@pytest.mark.run(order=12)
|
||||
def test_a_web_server_is_running(self):
|
||||
|
@ -132,23 +132,23 @@ class OnionShareGuiTest(unittest.TestCase):
|
|||
|
||||
@pytest.mark.run(order=14)
|
||||
def test_have_a_slug(self):
|
||||
CommonTests.test_have_a_slug(self, 'receive', False)
|
||||
CommonTests.test_have_a_slug(self, self.gui.receive_mode, False)
|
||||
|
||||
@pytest.mark.run(order=15)
|
||||
def test_url_description_shown(self):
|
||||
CommonTests.test_url_description_shown(self, 'receive')
|
||||
CommonTests.test_url_description_shown(self, self.gui.receive_mode)
|
||||
|
||||
@pytest.mark.run(order=16)
|
||||
def test_have_copy_url_button(self):
|
||||
CommonTests.test_have_copy_url_button(self, 'receive')
|
||||
CommonTests.test_have_copy_url_button(self, self.gui.receive_mode)
|
||||
|
||||
@pytest.mark.run(order=17)
|
||||
def test_server_status_indicator_says_started(self):
|
||||
CommonTests.test_server_status_indicator_says_started(self, 'receive')
|
||||
CommonTests.test_server_status_indicator_says_started(self, self.gui.receive_mode)
|
||||
|
||||
@pytest.mark.run(order=18)
|
||||
def test_web_page(self):
|
||||
CommonTests.test_web_page(self, 'receive', 'Select the files you want to send, then click', False)
|
||||
CommonTests.test_web_page(self, self.gui.receive_mode, 'Select the files you want to send, then click', False)
|
||||
|
||||
@pytest.mark.run(order=19)
|
||||
def test_upload_file(self):
|
||||
|
@ -156,11 +156,11 @@ class OnionShareGuiTest(unittest.TestCase):
|
|||
|
||||
@pytest.mark.run(order=20)
|
||||
def test_history_widgets_present(self):
|
||||
CommonTests.test_history_widgets_present(self, 'receive')
|
||||
CommonTests.test_history_widgets_present(self, self.gui.receive_mode)
|
||||
|
||||
@pytest.mark.run(order=21)
|
||||
def test_counter_incremented(self):
|
||||
CommonTests.test_counter_incremented(self, 'receive', 1)
|
||||
CommonTests.test_counter_incremented(self, self.gui.receive_mode, 1)
|
||||
|
||||
@pytest.mark.run(order=22)
|
||||
def test_upload_same_file_is_renamed(self):
|
||||
|
@ -168,15 +168,15 @@ class OnionShareGuiTest(unittest.TestCase):
|
|||
|
||||
@pytest.mark.run(order=23)
|
||||
def test_upload_count_incremented_again(self):
|
||||
CommonTests.test_counter_incremented(self, 'receive', 2)
|
||||
CommonTests.test_counter_incremented(self, self.gui.receive_mode, 2)
|
||||
|
||||
@pytest.mark.run(order=24)
|
||||
def test_history_indicator(self):
|
||||
CommonTests.test_history_indicator(self, 'receive', False)
|
||||
CommonTests.test_history_indicator(self, self.gui.receive_mode, False)
|
||||
|
||||
@pytest.mark.run(order=25)
|
||||
def test_server_is_stopped(self):
|
||||
CommonTests.test_server_is_stopped(self, 'receive', False)
|
||||
CommonTests.test_server_is_stopped(self, self.gui.receive_mode, False)
|
||||
|
||||
@pytest.mark.run(order=26)
|
||||
def test_web_service_is_stopped(self):
|
||||
|
@ -184,7 +184,7 @@ class OnionShareGuiTest(unittest.TestCase):
|
|||
|
||||
@pytest.mark.run(order=27)
|
||||
def test_server_status_indicator_says_closed(self):
|
||||
CommonTests.test_server_status_indicator_says_closed(self, 'receive', False)
|
||||
CommonTests.test_server_status_indicator_says_closed(self, self.gui.receive_mode, False)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue