diff --git a/tests/test_blob_repairer.py b/tests/test_blob_repairer.py index 62eddda..40a134e 100644 --- a/tests/test_blob_repairer.py +++ b/tests/test_blob_repairer.py @@ -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): @@ -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: diff --git a/tests/test_is_sortable.py b/tests/test_is_sortable.py index 434cb3f..7e76739 100644 --- a/tests/test_is_sortable.py +++ b/tests/test_is_sortable.py @@ -7,16 +7,19 @@ 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) @@ -24,4 +27,4 @@ def test_sequence_is_sorted_custom_key(): 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) \ No newline at end of file + assert not eblob_kit.is_sorted(sequence, lambda x: x.b)