def test_new_reference(self): c = eetf_construct.new_reference r = erlang_types.Reference("myatom", [0x12, 0x13], 0x48) self.assertEqual( c.parse( '\x00\x02\x64\x00\x06myatom\x48\x00\x00\x00\x12\x00\x00\x00\x13' ), r) self.assertEqual(c.parse(c.build(r)), r)
def test_reference(self): c = eetf.reference r = erlang_types.Reference(u"myatom", 0x12, 0x48) self.assertEqual(c.parse(b'\x64\x00\x06myatom\x00\x00\x00\x12\x48'), r) self.assertEqual(c.parse(c.build(r)), r) self.assertEqual(c.build(r), b'\x76\x00\x06myatom\x00\x00\x00\x12\x48')