예제 #1
0
 def testiterator(self):
     cmo = codecMetaObject(self.root.getroot())
     generator = cmo.allItems()
     item = generator.next()
     self.assertEquals('version', item.extract('name'))
     self.assertEquals('integer-reverse', item.extract('type'))
     result = {'startbyte': '3', 'endbyte': '4'}
     self.assertEquals(result, item.extractParams())
     item = generator.next()
     self.assertEquals('gmid', item.extract('name'))
     self.assertEquals('integer-reverse', item.extract('type'))
     result = {'startbyte': '6', 'endbyte': '8'}
     self.assertEquals(result, item.extractParams())
     item = generator.next()
     self.assertEquals('gamecycle', item.extract('name'))
     self.assertEquals('boolean', item.extract('type'))
     result = {'byte': '9', 'bit': '1'}
     self.assertEquals(result, item.extractParams())
     self.assertEquals(None, item.extract('unicode'))
     self.assertRaises(StopIteration, generator.next)
예제 #2
0
 def testiterator(self):
     cmo = codecMetaObject(self.root.getroot())
     generator = cmo.allItems()
     item = generator.next()
     self.assertEquals('version', item.extract('name'))
     self.assertEquals('integer-reverse', item.extract('type'))
     result = {'startbyte': '3', 'endbyte': '4'}
     self.assertEquals(result, item.extractParams())
     item = generator.next()
     self.assertEquals('gmid', item.extract('name'))
     self.assertEquals('integer-reverse', item.extract('type'))
     result = {'startbyte': '6', 'endbyte': '8'}
     self.assertEquals(result, item.extractParams())
     item = generator.next()
     self.assertEquals('gamecycle', item.extract('name'))
     self.assertEquals('boolean', item.extract('type'))
     result = {'byte': '9', 'bit': '1'}
     self.assertEquals(result, item.extractParams())
     self.assertEquals(None, item.extract('unicode'))
     self.assertRaises(StopIteration, generator.next)
예제 #3
0
 def testEssentialMethods(self):
     cmo = codecMetaObject(self.root.getroot())
     self.assertEquals(128, cmo.getPacketLength())
     self.assertEquals('sdb', cmo.getPacketName())
     self.assertEquals('00', cmo.getPacketPattern())
예제 #4
0
 def testEssentialMethods(self):
     cmo = codecMetaObject(self.root.getroot())
     self.assertEquals(128, cmo.getPacketLength())
     self.assertEquals('sdb', cmo.getPacketName())
     self.assertEquals('00', cmo.getPacketPattern())