コード例 #1
0
 def test_struct_byteorder_found_error(self):
     parsed_doc = ET.fromstring("<structure><byte_order>error_endian</byte_order></structure>")
     self.assertRaises(ValueError, lambda : structureparser.struct_byteorder(parsed_doc))
コード例 #2
0
 def test_struct_byteorder_found_littleendian(self):
     parsed_doc = ET.fromstring("<structure><byte_order>little_endian</byte_order></structure>")
     self.assertEqual(structureparser.struct_byteorder(parsed_doc), "little_endian")
コード例 #3
0
 def test_struct_byteorder_found_as_host(self):
     parsed_doc = ET.fromstring("<structure><byte_order>as_host</byte_order></structure>")
     self.assertEqual(structureparser.struct_byteorder(parsed_doc), "as_host")
コード例 #4
0
 def test_struct_byteorder_default(self):
     parsed_doc = ET.fromstring("<structure></structure>")
     self.assertEqual(structureparser.struct_byteorder(parsed_doc), "big_endian")
コード例 #5
0
 def test_struct_byteorder_found_error(self):
     parsed_doc = ET.fromstring(
         "<structure><byte_order>error_endian</byte_order></structure>")
     self.assertRaises(ValueError,
                       lambda: structureparser.struct_byteorder(parsed_doc))
コード例 #6
0
 def test_struct_byteorder_found_as_host(self):
     parsed_doc = ET.fromstring(
         "<structure><byte_order>as_host</byte_order></structure>")
     self.assertEqual(structureparser.struct_byteorder(parsed_doc),
                      "as_host")
コード例 #7
0
 def test_struct_byteorder_found_littleendian(self):
     parsed_doc = ET.fromstring(
         "<structure><byte_order>little_endian</byte_order></structure>")
     self.assertEqual(structureparser.struct_byteorder(parsed_doc),
                      "little_endian")
コード例 #8
0
 def test_struct_byteorder_default(self):
     parsed_doc = ET.fromstring("<structure></structure>")
     self.assertEqual(structureparser.struct_byteorder(parsed_doc),
                      "big_endian")