示例#1
0
    def test_read_magic_1(self):
        prefix = six.b('\x93NUMPY')
        prefix_len = 8
        fp = six.BytesIO(six.b('\x93NUMPY\x01\x01'))

        major, minor = fmt.read_magic(fp, prefix=prefix, prefix_len=prefix_len)

        expected = (1, 1)
        self.assertEqual((major, minor), expected)
示例#2
0
    def test_read_magic_0(self):
        prefix = six.b('\x93DARRY')
        prefix_len = 8
        fp = six.BytesIO(six.b('\x93DARRY\x03\x02'))

        major, minor = fmt.read_magic(fp, prefix=prefix, prefix_len=prefix_len)

        expected = (3, 2)
        self.assertEqual((major, minor), expected)