Beispiel #1
0
    def test_second_choice(self, get_input, s3_client, local_client):
        get_input.return_value = "2"

        action_1 = SyncState(SyncState.UPDATED, 1111, 2222)
        action_2 = SyncState(SyncState.DELETED, 3333, 4444)

        result = handle_conflict("movie", action_1, s3_client, action_2,
                                 local_client)
        assert result.action == Resolution.DELETE
Beispiel #2
0
    def test_skip(self, get_input, s3_client, local_client):
        get_input.return_value = "X"

        action_1 = SyncState(SyncState.UPDATED, 1111, 2222)
        action_2 = SyncState(SyncState.DELETED, 3333, 4444)

        result = handle_conflict("movie", action_1, s3_client, action_2,
                                 local_client)
        assert result is None
Beispiel #3
0
    def test_diff(self, show_diff, get_input, s3_client, local_client):
        get_input.side_effect = ["d", "X"]

        action_1 = SyncState(SyncState.UPDATED, 1111, 2222)
        action_2 = SyncState(SyncState.DELETED, 3333, 4444)

        result = handle_conflict("movie", action_1, s3_client, action_2,
                                 local_client)
        assert result is None
        assert show_diff.call_count == 1
        show_diff.assert_called_with(s3_client, local_client, "movie")
Beispiel #4
0
    def test_diff(self, show_diff, get_input, s3_client, local_client):
        get_input.side_effect = FakeInputStream([
            'd',
            'X',
        ])

        action_1 = SyncState(SyncState.UPDATED, 1111, 2222)
        action_2 = SyncState(SyncState.DELETED, 3333, 4444)

        result = handle_conflict(
            'movie',
            action_1,
            s3_client,
            action_2,
            local_client,
        )
        assert result is None
        assert show_diff.call_count == 1
        show_diff.assert_called_with(s3_client, local_client, 'movie')