mirror of
https://github.com/onionshare/onionshare.git
synced 2025-08-15 17:40:41 -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,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__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue