Exemple #1
0
    def test_dump_bit_at_end(self):
        class Bunch(WithFields):
            _fields = [('o1', 'octet'), ('b1', 'bit'), ('b2', 'bit'),
                       ('b3', 'bit')]

        o = Bunch(o1=97, b1=False, b2=True, b3=True)
        self.assertEquals(dump(o), 'a\x06')
Exemple #2
0
    def test_dump_bit(self):
        class Bunch(WithFields):
            _fields = [('o1', 'octet'), ('b1', 'bit'), ('b2', 'bit'),
                       ('o2', 'octet')]

        o = Bunch(o1=97, b1=False, b2=True, o2=98)
        self.assertEquals(dump(o), 'a\x02b')
 def test_dump_bit_at_end(self):
     class Bunch(WithFields):
         _fields = [('o1', 'octet'),
                    ('b1', 'bit'),
                    ('b2', 'bit'),
                    ('b3', 'bit')]
     o = Bunch(o1=97, b1 = False, b2 = True, b3=True)
     self.assertEquals(dump(o), 'a\x06')
 def test_dump_bit(self):
     class Bunch(WithFields):
         _fields = [('o1', 'octet'),
                    ('b1', 'bit'),
                    ('b2', 'bit'),
                    ('o2', 'octet')]
     o = Bunch(o1=97, b1 = False, b2 = True, o2=98)
     self.assertEquals(dump(o), 'a\x02b')