Example #1
0
    def test_applyDataMap_relmap(self):
        compname = "module/component"
        relname = "relationship"

        datamap = RelationshipMap()
        device = Device(id='test_device')
        device.dmd = self.dmd

        self.adm.applyDataMap(device, datamap, datamap.relname, datamap.compname)
    def test_applyDataMap_RelationshipMap_contains_IncrementalDataMap(t):
        '''A relationshipMap may contain IncrementalDataMaps
        in addition to ObjectMaps
        '''
        base = Device(id='owner')
        device = Device(id='related_device')
        device.dmd = Mock(name='dmd')
        relmap = RelationshipMap()
        relmap.append(IncrementalDataMap(device, ObjectMap({'comments':
                                                            'ok'})))

        t.adm.applyDataMap(base, relmap)

        t.assertEqual(device.comments, 'ok')