def test_show_sync_no_sync(mocker): """ If there's no value to display, default to a "waiting" message. """ w = Window() w.update_activity_status = mocker.MagicMock() w.show_sync(None) w.update_activity_status.assert_called_once_with('Waiting to refresh...', 5000)
def test_show_sync_no_sync(mocker): """ If there's no value to display, default to a "waiting" message. """ w = Window('mock') w.main_view = mocker.MagicMock() w.show_sync(None) w.main_view.status.setText.assert_called_once_with('Waiting to refresh...')
def test_show_sync_no_sync(): """ If there's no value to display, default to a "waiting" message. """ w = Window() w.main_view = mock.MagicMock() w.show_sync(None) w.main_view.status.setText.\ assert_called_once_with('Waiting to Synchronize')
def test_show_sync(): """ If there's a value display the result of its "humanize" method. """ w = Window() w.main_view = mock.MagicMock() updated_on = mock.MagicMock() w.show_sync(updated_on) w.main_view.status.setText.assert_called_once_with('Last Sync: ' + updated_on.humanize())
def test_show_sync(mocker): """ If there's a value display the result of its "humanize" method.humanize """ w = Window() w.update_activity_status = mocker.MagicMock() updated_on = mocker.MagicMock() w.show_sync(updated_on) w.update_activity_status.assert_called_once_with( 'Last Refresh: {}'.format(updated_on.humanize()))