mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-04 17:05:31 -05: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
@ -171,7 +171,7 @@ class CommonTests(object):
|
||||
|
||||
def test_counter_incremented(self, mode, count):
|
||||
'''Test that the counter has incremented'''
|
||||
self.assertEquals(mode.uploads_completed, count)
|
||||
self.assertEquals(mode.history.completed_count, count)
|
||||
|
||||
def test_server_is_stopped(self, mode, stay_open):
|
||||
'''Test that the server stops when we click Stop'''
|
||||
|
@ -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()
|
||||
|
@ -96,27 +96,27 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=5)
|
||||
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=9)
|
||||
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=10)
|
||||
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=11)
|
||||
def test_settings_button_is_hidden(self):
|
||||
@ -124,7 +124,7 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=12)
|
||||
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=13)
|
||||
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', True)
|
||||
CommonTests.test_have_a_slug(self, self.gui.receive_mode, True)
|
||||
|
||||
@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', True)
|
||||
CommonTests.test_web_page(self, self.gui.receive_mode, 'Select the files you want to send, then click', True)
|
||||
|
||||
@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', True)
|
||||
CommonTests.test_history_indicator(self, self.gui.receive_mode, True)
|
||||
|
||||
@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()
|
||||
|
@ -96,21 +96,17 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
def test_file_selection_widget_has_a_file(self):
|
||||
CommonTests.test_file_selection_widget_has_a_file(self)
|
||||
|
||||
@pytest.mark.run(order=6)
|
||||
def test_info_widget_shows_less(self):
|
||||
CommonTests.test_info_widget_shows_less(self, 'share')
|
||||
|
||||
@pytest.mark.run(order=7)
|
||||
def test_history_is_not_visible(self):
|
||||
CommonTests.test_history_is_not_visible(self, 'share')
|
||||
CommonTests.test_history_is_not_visible(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=8)
|
||||
def test_click_toggle_history(self):
|
||||
CommonTests.test_click_toggle_history(self, 'share')
|
||||
CommonTests.test_click_toggle_history(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=9)
|
||||
def test_history_is_visible(self):
|
||||
CommonTests.test_history_is_visible(self, 'share')
|
||||
CommonTests.test_history_is_visible(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=10)
|
||||
def test_deleting_only_file_hides_delete_button(self):
|
||||
@ -126,11 +122,11 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=13)
|
||||
def test_server_working_on_start_button_pressed(self):
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, 'share')
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=14)
|
||||
def test_server_status_indicator_says_starting(self):
|
||||
CommonTests.test_server_status_indicator_says_starting(self, 'share')
|
||||
CommonTests.test_server_status_indicator_says_starting(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=15)
|
||||
def test_add_delete_buttons_hidden(self):
|
||||
@ -142,7 +138,7 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=17)
|
||||
def test_a_server_is_started(self):
|
||||
CommonTests.test_a_server_is_started(self, 'share')
|
||||
CommonTests.test_a_server_is_started(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=18)
|
||||
def test_a_web_server_is_running(self):
|
||||
@ -150,23 +146,23 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=19)
|
||||
def test_have_a_slug(self):
|
||||
CommonTests.test_have_a_slug(self, 'share', False)
|
||||
CommonTests.test_have_a_slug(self, self.gui.share_mode, False)
|
||||
|
||||
@pytest.mark.run(order=20)
|
||||
def test_url_description_shown(self):
|
||||
CommonTests.test_url_description_shown(self, 'share')
|
||||
CommonTests.test_url_description_shown(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=21)
|
||||
def test_have_copy_url_button(self):
|
||||
CommonTests.test_have_copy_url_button(self, 'share')
|
||||
CommonTests.test_have_copy_url_button(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=22)
|
||||
def test_server_status_indicator_says_started(self):
|
||||
CommonTests.test_server_status_indicator_says_started(self, 'share')
|
||||
CommonTests.test_server_status_indicator_says_started(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=23)
|
||||
def test_web_page(self):
|
||||
CommonTests.test_web_page(self, 'share', 'Total size', False)
|
||||
CommonTests.test_web_page(self, self.gui.share_mode, 'Total size', False)
|
||||
|
||||
@pytest.mark.run(order=24)
|
||||
def test_download_share(self):
|
||||
@ -174,11 +170,11 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=25)
|
||||
def test_history_widgets_present(self):
|
||||
CommonTests.test_history_widgets_present(self, 'share')
|
||||
CommonTests.test_history_widgets_present(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=26)
|
||||
def test_server_is_stopped(self):
|
||||
CommonTests.test_server_is_stopped(self, 'share', False)
|
||||
CommonTests.test_server_is_stopped(self, self.gui.share_mode, False)
|
||||
|
||||
@pytest.mark.run(order=27)
|
||||
def test_web_service_is_stopped(self):
|
||||
@ -186,7 +182,7 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=28)
|
||||
def test_server_status_indicator_says_closed(self):
|
||||
CommonTests.test_server_status_indicator_says_closed(self, 'share', False)
|
||||
CommonTests.test_server_status_indicator_says_closed(self, self.gui.share_mode, False)
|
||||
|
||||
@pytest.mark.run(order=29)
|
||||
def test_add_button_visible(self):
|
||||
@ -194,9 +190,9 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=30)
|
||||
def test_history_indicator(self):
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, 'share')
|
||||
CommonTests.test_a_server_is_started(self, 'share')
|
||||
CommonTests.test_history_indicator(self, 'share', False)
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, self.gui.share_mode)
|
||||
CommonTests.test_a_server_is_started(self, self.gui.share_mode)
|
||||
CommonTests.test_history_indicator(self, self.gui.share_mode, False)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -96,21 +96,17 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
def test_file_selection_widget_has_a_file(self):
|
||||
CommonTests.test_file_selection_widget_has_a_file(self)
|
||||
|
||||
@pytest.mark.run(order=6)
|
||||
def test_info_widget_shows_less(self):
|
||||
CommonTests.test_info_widget_shows_less(self, 'share')
|
||||
|
||||
@pytest.mark.run(order=7)
|
||||
def test_history_is_not_visible(self):
|
||||
CommonTests.test_history_is_not_visible(self, 'share')
|
||||
CommonTests.test_history_is_not_visible(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=8)
|
||||
def test_click_toggle_history(self):
|
||||
CommonTests.test_click_toggle_history(self, 'share')
|
||||
CommonTests.test_click_toggle_history(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=9)
|
||||
def test_history_is_visible(self):
|
||||
CommonTests.test_history_is_visible(self, 'share')
|
||||
CommonTests.test_history_is_visible(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=10)
|
||||
def test_deleting_only_file_hides_delete_button(self):
|
||||
@ -126,11 +122,11 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=13)
|
||||
def test_server_working_on_start_button_pressed(self):
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, 'share')
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=14)
|
||||
def test_server_status_indicator_says_starting(self):
|
||||
CommonTests.test_server_status_indicator_says_starting(self, 'share')
|
||||
CommonTests.test_server_status_indicator_says_starting(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=15)
|
||||
def test_add_delete_buttons_hidden(self):
|
||||
@ -142,7 +138,7 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=17)
|
||||
def test_a_server_is_started(self):
|
||||
CommonTests.test_a_server_is_started(self, 'share')
|
||||
CommonTests.test_a_server_is_started(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=18)
|
||||
def test_a_web_server_is_running(self):
|
||||
@ -150,23 +146,23 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=19)
|
||||
def test_have_a_slug(self):
|
||||
CommonTests.test_have_a_slug(self, 'share', True)
|
||||
CommonTests.test_have_a_slug(self, self.gui.share_mode, True)
|
||||
|
||||
@pytest.mark.run(order=20)
|
||||
def test_url_description_shown(self):
|
||||
CommonTests.test_url_description_shown(self, 'share')
|
||||
CommonTests.test_url_description_shown(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=21)
|
||||
def test_have_copy_url_button(self):
|
||||
CommonTests.test_have_copy_url_button(self, 'share')
|
||||
CommonTests.test_have_copy_url_button(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=22)
|
||||
def test_server_status_indicator_says_started(self):
|
||||
CommonTests.test_server_status_indicator_says_started(self, 'share')
|
||||
CommonTests.test_server_status_indicator_says_started(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=23)
|
||||
def test_web_page(self):
|
||||
CommonTests.test_web_page(self, 'share', 'Total size', True)
|
||||
CommonTests.test_web_page(self, self.gui.share_mode, 'Total size', True)
|
||||
|
||||
@pytest.mark.run(order=24)
|
||||
def test_download_share(self):
|
||||
@ -174,11 +170,11 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=25)
|
||||
def test_history_widgets_present(self):
|
||||
CommonTests.test_history_widgets_present(self, 'share')
|
||||
CommonTests.test_history_widgets_present(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=26)
|
||||
def test_counter_incremented(self):
|
||||
CommonTests.test_counter_incremented(self, 'share', 1)
|
||||
CommonTests.test_counter_incremented(self, self.gui.share_mode, 1)
|
||||
|
||||
@pytest.mark.run(order=27)
|
||||
def test_download_share_again(self):
|
||||
@ -186,11 +182,11 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=28)
|
||||
def test_counter_incremented_again(self):
|
||||
CommonTests.test_counter_incremented(self, 'share', 2)
|
||||
CommonTests.test_counter_incremented(self, self.gui.share_mode, 2)
|
||||
|
||||
@pytest.mark.run(order=29)
|
||||
def test_server_is_stopped(self):
|
||||
CommonTests.test_server_is_stopped(self, 'share', True)
|
||||
CommonTests.test_server_is_stopped(self, self.gui.share_mode, True)
|
||||
|
||||
@pytest.mark.run(order=30)
|
||||
def test_web_service_is_stopped(self):
|
||||
@ -198,7 +194,7 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=31)
|
||||
def test_server_status_indicator_says_closed(self):
|
||||
CommonTests.test_server_status_indicator_says_closed(self, 'share', True)
|
||||
CommonTests.test_server_status_indicator_says_closed(self, self.gui.share_mode, True)
|
||||
|
||||
@pytest.mark.run(order=32)
|
||||
def test_add_button_visible(self):
|
||||
@ -206,9 +202,9 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=33)
|
||||
def test_history_indicator(self):
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, 'share')
|
||||
CommonTests.test_a_server_is_started(self, 'share')
|
||||
CommonTests.test_history_indicator(self, 'share', True)
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, self.gui.share_mode)
|
||||
CommonTests.test_a_server_is_started(self, self.gui.share_mode)
|
||||
CommonTests.test_history_indicator(self, self.gui.share_mode, True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -94,29 +94,25 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
def test_server_status_bar_is_visible(self):
|
||||
CommonTests.test_server_status_bar_is_visible(self)
|
||||
|
||||
@pytest.mark.run(order=6)
|
||||
def test_info_widget_shows_less(self):
|
||||
CommonTests.test_info_widget_shows_less(self, 'share')
|
||||
|
||||
@pytest.mark.run(order=7)
|
||||
def test_history_is_not_visible(self):
|
||||
CommonTests.test_history_is_not_visible(self, 'share')
|
||||
CommonTests.test_history_is_not_visible(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=8)
|
||||
def test_click_toggle_history(self):
|
||||
CommonTests.test_click_toggle_history(self, 'share')
|
||||
CommonTests.test_click_toggle_history(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=9)
|
||||
def test_history_is_visible(self):
|
||||
CommonTests.test_history_is_visible(self, 'share')
|
||||
CommonTests.test_history_is_visible(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=10)
|
||||
def test_server_working_on_start_button_pressed(self):
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, 'share')
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=11)
|
||||
def test_server_status_indicator_says_starting(self):
|
||||
CommonTests.test_server_status_indicator_says_starting(self, 'share')
|
||||
CommonTests.test_server_status_indicator_says_starting(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=12)
|
||||
def test_settings_button_is_hidden(self):
|
||||
@ -124,7 +120,7 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=13)
|
||||
def test_a_server_is_started(self):
|
||||
CommonTests.test_a_server_is_started(self, 'share')
|
||||
CommonTests.test_a_server_is_started(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=14)
|
||||
def test_a_web_server_is_running(self):
|
||||
@ -132,17 +128,17 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=15)
|
||||
def test_have_a_slug(self):
|
||||
CommonTests.test_have_a_slug(self, 'share', False)
|
||||
CommonTests.test_have_a_slug(self, self.gui.share_mode, False)
|
||||
global slug
|
||||
slug = self.gui.share_mode.server_status.web.slug
|
||||
|
||||
@pytest.mark.run(order=16)
|
||||
def test_server_status_indicator_says_started(self):
|
||||
CommonTests.test_server_status_indicator_says_started(self, 'share')
|
||||
CommonTests.test_server_status_indicator_says_started(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=17)
|
||||
def test_server_is_stopped(self):
|
||||
CommonTests.test_server_is_stopped(self, 'share', True)
|
||||
CommonTests.test_server_is_stopped(self, self.gui.share_mode, True)
|
||||
|
||||
@pytest.mark.run(order=18)
|
||||
def test_web_service_is_stopped(self):
|
||||
@ -150,13 +146,13 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=19)
|
||||
def test_server_status_indicator_says_closed(self):
|
||||
CommonTests.test_server_status_indicator_says_closed(self, 'share', True)
|
||||
CommonTests.test_server_status_indicator_says_closed(self, self.gui.share_mode, True)
|
||||
|
||||
@pytest.mark.run(order=20)
|
||||
def test_server_started_again(self):
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, 'share')
|
||||
CommonTests.test_server_status_indicator_says_starting(self, 'share')
|
||||
CommonTests.test_a_server_is_started(self, 'share')
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, self.gui.share_mode)
|
||||
CommonTests.test_server_status_indicator_says_starting(self, self.gui.share_mode)
|
||||
CommonTests.test_a_server_is_started(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=21)
|
||||
def test_have_same_slug(self):
|
||||
@ -165,14 +161,14 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=22)
|
||||
def test_server_is_stopped_again(self):
|
||||
CommonTests.test_server_is_stopped(self, 'share', True)
|
||||
CommonTests.test_server_is_stopped(self, self.gui.share_mode, True)
|
||||
CommonTests.test_web_service_is_stopped(self)
|
||||
|
||||
@pytest.mark.run(order=23)
|
||||
def test_history_indicator(self):
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, 'share')
|
||||
CommonTests.test_a_server_is_started(self, 'share')
|
||||
CommonTests.test_history_indicator(self, 'share', False)
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, self.gui.share_mode)
|
||||
CommonTests.test_a_server_is_started(self, self.gui.share_mode)
|
||||
CommonTests.test_history_indicator(self, self.gui.share_mode, False)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -96,29 +96,25 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
def test_file_selection_widget_has_a_file(self):
|
||||
CommonTests.test_file_selection_widget_has_a_file(self)
|
||||
|
||||
@pytest.mark.run(order=6)
|
||||
def test_info_widget_shows_less(self):
|
||||
CommonTests.test_info_widget_shows_less(self, 'share')
|
||||
|
||||
@pytest.mark.run(order=7)
|
||||
def test_history_is_not_visible(self):
|
||||
CommonTests.test_history_is_not_visible(self, 'share')
|
||||
CommonTests.test_history_is_not_visible(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=8)
|
||||
def test_set_timeout(self):
|
||||
CommonTests.test_set_timeout(self, 'share', 5)
|
||||
CommonTests.test_set_timeout(self, self.gui.share_mode, 5)
|
||||
|
||||
@pytest.mark.run(order=9)
|
||||
def test_server_working_on_start_button_pressed(self):
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, 'share')
|
||||
CommonTests.test_server_working_on_start_button_pressed(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=10)
|
||||
def test_server_status_indicator_says_starting(self):
|
||||
CommonTests.test_server_status_indicator_says_starting(self, 'share')
|
||||
CommonTests.test_server_status_indicator_says_starting(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=11)
|
||||
def test_a_server_is_started(self):
|
||||
CommonTests.test_a_server_is_started(self, 'share')
|
||||
CommonTests.test_a_server_is_started(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=12)
|
||||
def test_a_web_server_is_running(self):
|
||||
@ -126,11 +122,11 @@ class OnionShareGuiTest(unittest.TestCase):
|
||||
|
||||
@pytest.mark.run(order=13)
|
||||
def test_timeout_widget_hidden(self):
|
||||
CommonTests.test_timeout_widget_hidden(self, 'share')
|
||||
CommonTests.test_timeout_widget_hidden(self, self.gui.share_mode)
|
||||
|
||||
@pytest.mark.run(order=14)
|
||||
def test_timeout(self):
|
||||
CommonTests.test_server_timed_out(self, 'share', 10000)
|
||||
CommonTests.test_server_timed_out(self, self.gui.share_mode, 10000)
|
||||
|
||||
@pytest.mark.run(order=15)
|
||||
def test_web_service_is_stopped(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user