Added tests for deleting all files

This commit is contained in:
Rob McMullen 2017-02-24 10:13:31 -08:00
parent 9733aa4777
commit 68469e8e92

View File

@ -118,6 +118,25 @@ class BaseFilesystemModifyTest(object):
filename = self.check_entries(entries2, "SECOND", save="test_delete.atr") filename = self.check_entries(entries2, "SECOND", save="test_delete.atr")
assert len(self.image.files) == self.num_files_in_sample + 9 assert len(self.image.files) == self.num_files_in_sample + 9
def test_delete_all(self):
entries1 = [
np.arange(3*1024, dtype=np.uint8),
np.arange(3*1024, dtype=np.uint8),
np.arange(3*1024, dtype=np.uint8),
np.arange(3*1024, dtype=np.uint8),
np.arange(3*1024, dtype=np.uint8),
np.arange(3*1024, dtype=np.uint8),
np.arange(3*1024, dtype=np.uint8),
np.arange(3*1024, dtype=np.uint8),
np.arange(3*1024, dtype=np.uint8),
np.arange(10*1024, dtype=np.uint8),
np.arange(11*1024, dtype=np.uint8),
np.arange(12*1024, dtype=np.uint8),
]
for dirent in self.image.files:
self.image.delete_file(dirent.filename)
assert len(self.image.files) == 0
class TestAtariDosSDImage(BaseFilesystemModifyTest): class TestAtariDosSDImage(BaseFilesystemModifyTest):
diskimage_type = AtariDosDiskImage diskimage_type = AtariDosDiskImage
sample_file = "../test_data/dos_sd_test1.atr" sample_file = "../test_data/dos_sd_test1.atr"