Skip to content

Commit

Permalink
add on_sync test to test when sync finishes;
Browse files Browse the repository at this point in the history
  • Loading branch information
Allie Crevier committed Apr 9, 2020
1 parent 98e919d commit 5dbad34
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/gui/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ def test_SyncIcon_disable_starts_animiation(mocker):
sync_icon.sync_animation.start.assert_called_with()


def test_SyncIcon__on_sync(mocker):
def test_SyncIcon__on_sync_syncing(mocker):
'''
Sync icon becomes active when it receives the syncing sync signal.
Sync icon becomes active when it receives the `syncing` signal.
'''
sync_icon = SyncIcon()

Expand All @@ -247,6 +247,19 @@ def test_SyncIcon__on_sync(mocker):
assert filename == 'sync_active.gif'


def test_SyncIcon__on_sync_synced(mocker):
'''
Sync icon becomes "inactive" when it receives the `synced` signal.
'''
sync_icon = SyncIcon()

sync_icon._on_sync('synced')

file_path = sync_icon.sync_animation.fileName()
filename = file_path[file_path.rfind('/') + 1:]
assert filename == 'sync.gif'


def test_SyncIcon___on_sync_with_data_not_equal_to_syncing(mocker):
'''
Sync does not because active when the sync signal's data is something other than 'syncing'
Expand Down

0 comments on commit 5dbad34

Please sign in to comment.