예제 #1
0
 def test_onefield_struct(self):
     parsed_doc = parser.parse(self.xmlOneFieldSource)
     res = ws.build_struct(parsed_doc["structures"][0], parsed_doc["header"]["name"])
     self.assertEqual(res, norm_multiline_str("""
         struct stdUDPHeader
         {
             byte_order big_endian;
             muhheader header;
             uint16 MessageID;
         }
         """) )
예제 #2
0
 def test_onefield_struct(self):
     parsed_doc = parser.parse(self.xmlOneFieldSource)
     res = ws.build_struct(parsed_doc["structures"][0],
                           parsed_doc["header"]["name"])
     self.assertEqual(
         res,
         norm_multiline_str("""
         struct stdUDPHeader
         {
             byte_order big_endian;
             muhheader header;
             uint16 MessageID;
         }
         """))
예제 #3
0
 def test_multiplefields_struct(self):
     parsed_doc = parser.parse(self.xmlSource)
     res = ws.build_struct(parsed_doc["structures"][0], parsed_doc["header"]["name"])
     self.assertEqual(res, norm_multiline_str("""
         struct stdUDPHeader
         {
             byte_order big_endian;
             muhheader header;
             uint16 MessageID;
             uint16 MessageLenght;
             uint32 MessageCount;
             int64 MessageSendTime;
             uint32 MessageChecksum;
         }
         """) )
예제 #4
0
 def test_multiplefields_struct(self):
     parsed_doc = parser.parse(self.xmlSource)
     res = ws.build_struct(parsed_doc["structures"][0],
                           parsed_doc["header"]["name"])
     self.assertEqual(
         res,
         norm_multiline_str("""
         struct stdUDPHeader
         {
             byte_order big_endian;
             muhheader header;
             uint16 MessageID;
             uint16 MessageLenght;
             uint32 MessageCount;
             int64 MessageSendTime;
             uint32 MessageChecksum;
         }
         """))
예제 #5
0
 def setUp(self):
     with open("tests/test_data/stdUDPHeader.xml") as test_data:
         self.xmlSource = test_data.read()
     self.parsed_doc = structureparser.parse(self.xmlSource)
예제 #6
0
 def setUp(self):
     with open("tests/test_data/stdUDPHeader.xml") as test_data:
         self.xmlSource = test_data.read()
     self.parsed_doc = structureparser.parse(self.xmlSource)
예제 #7
0
 def setUp(self):
     with open("tests/test_data/stdUDPHeader.xml") as stdUDPHeader:
         self.xmlSource = stdUDPHeader.read()
     parsed_doc = parser.parse(self.xmlSource)
     self.res = ws.build_wsgd(parsed_doc, "stdUDPHeader")
예제 #8
0
 def setUp(self):
     with open("tests/test_data/stdUDPHeader.xml") as stdUDPHeader:
         self.xmlSource = stdUDPHeader.read()
     parsed_doc = parser.parse(self.xmlSource)
     self.res = ws.build_wsgd(parsed_doc, "stdUDPHeader")