Skip to content

Commit

Permalink
test: remove unused mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
karitra committed Jul 5, 2019
1 parent 7ef8b71 commit 0d9e2b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 1 addition & 6 deletions tests/test_blob_repairer.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def test_check_index_non_valid(_mocked_exists,
@mock.patch('eblob_kit.is_destination_writable', return_value=True)
@mock.patch(OPEN_TO_PATCH, new_callable=mock.mock_open)
@mock.patch('eblob_kit.Blob', autospec=True)
def test_fix_destination_writable(mocked_blob,
def test_fix_destination_writable(_mocked_blob,
_mocked_open,
_mocked_is_writable,
callee):
Expand All @@ -426,11 +426,6 @@ def test_fix_destination_writable(mocked_blob,
Checks for `copy_valid_records`, `recover_index` and `recover_blob`.
"""
mocked_blob.create.return_value = mocked_blob
mocked_blob.get_index_data_path_tuple.return_value = (None, None)

type(mocked_blob.return_value.data).path = mock.PropertyMock(return_value='data')

blob_repairer = BlobRepairer('.')

if callee == BlobRepairer.recover_index:
Expand Down
5 changes: 4 additions & 1 deletion tests/test_is_sortable.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@


def test_sequence_is_sorted_default_key():
"""Test that sequence is sorted with default key selector."""
sorted_sequence = [-1, 1, 2, 3, 4, 5, 10, 100, 1000]
assert eblob_kit.is_sorted(sorted_sequence)


def test_sequence_not_sorted_default_key():
"""Test that sequence is not sorted with default key selector."""
non_sorted_sequence = [-1, 1, 2, 3, 4, 5, 10, 100, 99, 1000]
assert not eblob_kit.is_sorted(non_sorted_sequence)


def test_sequence_is_sorted_custom_key():
"""Test sequence is sorted with custom field selector."""
sequence_length = 5
sequence = [
DummyRecord(i, sequence_length - i) for i in xrange(sequence_length)
]

assert eblob_kit.is_sorted(sequence)
assert eblob_kit.is_sorted(sequence, lambda x: x.a)
assert not eblob_kit.is_sorted(sequence, lambda x: x.b)
assert not eblob_kit.is_sorted(sequence, lambda x: x.b)

0 comments on commit 0d9e2b1

Please sign in to comment.