def test_normalise_unknown_byte_orders(self): for byte_order in ['|', 'I', 'other', 'S', 'N', 'L', 'B']: with self.assertRaisesRegex(ValueError, "Unrecognised byte order indicator"): utils.normalise_byte_order(byte_order)
def test_normalise_big_endian_byte_order(self): assert utils.normalise_byte_order('>') == '>'
def test_normalise_native_byte_order(self): if sys.byteorder == 'little': assert utils.normalise_byte_order('=') == '<' else: assert utils.normalise_byte_order('=') == '>'
def test_normalise_little_endian_byte_order(self): assert utils.normalise_byte_order('<') == '<'