Пример #1
0
    def testDeserializeDict(self):
        brl = BlockCellName("user/block/path/file.h")
        brl2 = BlockCellName("user/block/path/file2.h")

        h = {brl.serialize(): "asasdasdasd",
             brl2.serialize(): "1123"
        }
        ret = DictDeserializer(BlockCellName, str).deserialize(h)
        self.assertEqual(ret, {'user/block/path/file.h': 'asasdasdasd',
                               'user/block/path/file2.h': '1123'})

        h = {brl.serialize(): brl.serialize(),
             brl2.serialize(): brl.serialize()
        }

        ret = DictDeserializer(BlockCellName, BlockCellName).deserialize(h)
        self.assertEqual(ret,
                         {'user/block/path/file.h': 'user/block/path/file.h',
                          'user/block/path/file2.h': 'user/block/path/file.h'}
                        )
 def test_block_cell_name(self):
     b = BlockCellName("user/block/path/file.h")
     s = b.serialize()
     b2 = BlockCellName.deserialize(s)
     self.assertEqual(b, b2)
Пример #3
0
 def test_block_cell_name(self):
     b = BlockCellName("user/block/path/file.h")
     s = b.serialize()
     b2 = BlockCellName.deserialize(s)
     self.assertEqual(b, b2)