def test_simple_published_cell(self): # Simple publish resource simpleresource = SimpleCell("user/block/path/to/file.h") simpleresource.ID = ID() simpleresource.root = ID() # Include inside "a" the "kls" attribute s = simpleresource.serialize() self.assertEqual(s[Deserializer.POLIMORPHIC_KEYWORD], ClassTypedSerializer.getValue(simpleresource.__class__)) ob = CellDeserializer(ID).deserialize(s) self.assert_bii_equal(simpleresource, ob)
def test_simple_edition_cell_with_container(self): virtual_cell = BlockCellName('user/block/path/file.h') simpleresource = SimpleCell("user/block/path/to/file.h") simpleresource.ID = BlockCellName("user/block/path/to/file.h") simpleresource.root = ID() simpleresource.dependencies.add_implicit(BlockCellName("user/block/path/file.h")) simpleresource.container = virtual_cell s = simpleresource.serialize() self.assertEqual(s[Deserializer.POLIMORPHIC_KEYWORD], ClassTypedSerializer.getValue(SimpleCell)) ob = CellDeserializer(BlockCellName).deserialize(s) self.assert_bii_equal(ob, simpleresource)
def test_simple_published_cell(self): # Simple publish resource simpleresource = SimpleCell("user/block/path/to/file.h") simpleresource.ID = ID() simpleresource.root = ID() # Include inside "a" the "kls" attribute s = simpleresource.serialize() self.assertEqual( s[Deserializer.POLIMORPHIC_KEYWORD], ClassTypedSerializer.getValue(simpleresource.__class__)) ob = CellDeserializer(ID).deserialize(s) self.assert_bii_equal(simpleresource, ob)
def test_simple_edition_cell_with_container(self): virtual_cell = BlockCellName('user/block/path/file.h') simpleresource = SimpleCell("user/block/path/to/file.h") simpleresource.ID = BlockCellName("user/block/path/to/file.h") simpleresource.root = ID() simpleresource.dependencies.add_implicit( BlockCellName("user/block/path/file.h")) simpleresource.container = virtual_cell s = simpleresource.serialize() self.assertEqual(s[Deserializer.POLIMORPHIC_KEYWORD], ClassTypedSerializer.getValue(SimpleCell)) ob = CellDeserializer(BlockCellName).deserialize(s) self.assert_bii_equal(ob, simpleresource)