mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2024-06-12 04:29:32 +00:00
29 lines
761 B
Python
29 lines
761 B
Python
import numpy as np
|
|
|
|
from mock import *
|
|
|
|
from atrcopy import SegmentData, AtariDosDiskImage, InvalidBinaryFile
|
|
|
|
|
|
class TestAtariDosSDImage(object):
|
|
def setup(self):
|
|
data = np.fromfile("../test_data/dos_sd_test1.atr", dtype=np.uint8)
|
|
rawdata = SegmentData(data)
|
|
self.image = AtariDosDiskImage(rawdata)
|
|
|
|
def test_small(self):
|
|
assert len(self.image.files) == 5
|
|
|
|
data = np.asarray([0xff, 0xff, 0x00, 0x60, 0x01, 0x60, 1, 2], dtype=np.uint8)
|
|
self.image.write_file("TEST.XEX", None, data)
|
|
assert len(self.image.files) == 6
|
|
|
|
data2 = self.image.find_file("TEST.XEX")
|
|
assert data.tostring() == data2
|
|
|
|
|
|
if __name__ == "__main__":
|
|
t = TestAtariDosFile()
|
|
t.setup()
|
|
t.test_segment()
|