예제 #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")