Пример #1
0
    def test_little_endian(self):
        self.assertEqual(_binary.i16le(b"\xff\xff\x00\x00"), 65535)
        self.assertEqual(_binary.i32le(b"\xff\xff\x00\x00"), 65535)

        self.assertEqual(_binary.o16le(65535), b"\xff\xff")
        self.assertEqual(_binary.o32le(65535), b"\xff\xff\x00\x00")
Пример #2
0
    def test_little_endian(self):
        self.assertEqual(_binary.i16le(b'\xff\xff\x00\x00'), 65535)
        self.assertEqual(_binary.i32le(b'\xff\xff\x00\x00'), 65535)

        self.assertEqual(_binary.o16le(65535), b'\xff\xff')
        self.assertEqual(_binary.o32le(65535), b'\xff\xff\x00\x00')
Пример #3
0
def test_little_endian():
    assert _binary.i16le(b"\xff\xff\x00\x00") == 65535
    assert _binary.i32le(b"\xff\xff\x00\x00") == 65535

    assert _binary.o16le(65535) == b"\xff\xff"
    assert _binary.o32le(65535) == b"\xff\xff\x00\x00"