def test_pack(self): # example 3.16 from The Book, p74 from smspdu.pdu import pack_date d = map(ord, pack_date('011223095342+04')) self.assertEquals(d, [16, 33, 50, 144, 53, 36, 64])
def test_pack(self): # example 3.16 from The Book, p74 from smspdu.pdu import pack_date d = list(b for b in pack_date('011223095342+04')) self.assertEqual(d, [16, 33, 50, 144, 53, 36, 64])
def _test(self, value): from smspdu.pdu import unpack_date, pack_date self.assertEqual(unpack_date(pack_date(value)), value)