Beispiel #1
0
 def test_adding_same_files_to_two_records_make_them_equal(self):
     a = WheelRecord()
     b = WheelRecord()
     buf = BytesIO(bytes(1000))
     a.update('file', buf)
     buf.seek(0)
     b.update('file', buf)
Beispiel #2
0
 def test_update_throws_on_directory_entry(self):
     with pytest.raises(RecordContainsDirectoryError):
         wr = WheelRecord()
         wr.update('path/to/a/directory/', BytesIO(bytes(1)))
Beispiel #3
0
 def test_has_membership_operator_for_paths_in_the_record(self):
     wr = WheelRecord()
     wr.update('some/particular/path', BytesIO(bytes(1)))
     assert 'some/particular/path' in wr
Beispiel #4
0
 def test_stringification_is_stable(self):
     wr = WheelRecord()
     buf = BytesIO(bytes(1000))
     wr.update('file', buf)
     assert str(WheelRecord.from_str(str(wr))) == str(wr)