Exemplo n.º 1
0
 def test_map_carbon_setting_with_data(self):
     mapper = model.get_mapper('carbon')
     c1 = model.ConfmlSetting("test", name="test")
     c2 = mapper.map_object(c1)
     self.assertTrue(isinstance(c2, carbonmodel.CarbonSetting))
     self.assertEquals(c2.name, "test")
     self.assertEquals(c2.ref, "test")
Exemplo n.º 2
0
 def test_map_carbon_feature(self):
     mapper = model.get_mapper('carbon')
     c1 = model.ConfmlFeature("test", name="test")
     c2 = mapper.map_object(c1)
     self.assertTrue(isinstance(c2, carbonmodel.CarbonFeature))
     self.assertEquals(c2.name, "test")
     self.assertEquals(c2.ref, "test")
Exemplo n.º 3
0
 def test_map_carbon_featurelist(self):
     mapper = model.get_mapper('carbon')
     c1 = model.ConfmlConfiguration(name="test")
     c1.meta = {}
     c1.meta.add('type', 'featurelist')
     c2 = mapper.configuration(c1)
     self.assertTrue(isinstance(c2, carbonmodel.FeatureList))
     c2 = mapper.map_object(c1)
     self.assertTrue(isinstance(c2, carbonmodel.FeatureList))
Exemplo n.º 4
0
 def test_map_carbon_configuration(self):
     mapper = model.get_mapper('carbon')
     c1 = model.ConfmlConfiguration("test")
     c2 = mapper.configuration(c1)
     c3 = c1._get_mapper('carbon').map_object(c1)
     self.assertTrue(isinstance(c2, carbonmodel.CarbonConfiguration))
     c2 = mapper.map_object(c1)
     self.assertTrue(isinstance(c2, carbonmodel.CarbonConfiguration))
     self.assertTrue(isinstance(c3, carbonmodel.CarbonConfiguration))
Exemplo n.º 5
0
 def test_map_carbon_configuration_with_data(self):
     mapper = model.get_mapper('carbon')
     c1 = model.ConfmlConfiguration("test")
     c1.name = "test.confml"
     c1.namespace = "com.nokia"
     c2 = mapper.map_object(c1)
     self.assertTrue(isinstance(c2, carbonmodel.CarbonConfiguration))
     self.assertEquals(c2.name, "test.confml")
     self.assertEquals(c2.namespace, "com.nokia")
     self.assertEquals(c2.path, "test")
Exemplo n.º 6
0
 def test_get_mapper(self):
     mapper = model.get_mapper('carbon')
     self.assertTrue(isinstance(mapper, mapping.Confml2carbon))