Example #1
0
 def test_remote(self):
     """Test the remote property"""
     ent1 = BaseEntity('father')
     self.assertTrue(ent1.remote)
     ent1.remote = False
     ent2 = BaseEntity('child')
     ent2.inherits_from(ent1)
     self.assertFalse(ent2.remote)
Example #2
0
 def test_remote(self):
     """Test the remote property"""
     ent1 = BaseEntity('father')
     self.assertTrue(ent1.remote)
     ent1.remote = False
     ent2 = BaseEntity('child')
     ent2.inherits_from(ent1)
     self.assertFalse(ent2.remote)
Example #3
0
    def test_tags(self):
        """Test tags property"""
        ent1 = BaseEntity(name='parent')
        self.assertEqual(ent1.tags, set())
        ent1.tags.add('foo')

        ent2 = BaseEntity(name='child')
        ent2.inherits_from(ent1)
        self.assertEqual(ent2.tags, set(['foo']))
        ent2.tags = set(['bar'])
        self.assertEqual(ent2.tags, set(['bar']))
Example #4
0
 def test_inheritance_of_non_existing_target(self):
     '''
     Test inheritance between entities with non-existing target/description
     '''
     ent1 = BaseEntity(name='parent')
     ent1.desc = "foo"
     ent2 = BaseEntity(name='child', target="@none")
     ent2.desc = ""
     ent2.inherits_from(ent1)
     self.assertEqual(ent2.target, NodeSet())
     self.assertEqual(ent2.desc, "")
Example #5
0
    def test_tags(self):
        """Test tags property"""
        ent1 = BaseEntity(name='parent')
        self.assertEqual(ent1.tags, set())
        ent1.tags.add('foo')

        ent2 = BaseEntity(name='child')
        ent2.inherits_from(ent1)
        self.assertEqual(ent2.tags, set(['foo']))
        ent2.tags = set(['bar'])
        self.assertEqual(ent2.tags, set(['bar']))
Example #6
0
 def test_inheritance_of_non_existing_target(self):
     '''
     Test inheritance between entities with non-existing target/description
     '''
     ent1 = BaseEntity(name='parent')
     ent1.desc = "foo"
     ent2 = BaseEntity(name='child', target="@none")
     ent2.desc = ""
     ent2.inherits_from(ent1)
     self.assertEqual(ent2.target, NodeSet())
     self.assertEqual(ent2.desc, "")
Example #7
0
 def test_inheritance_of_properties1(self):
     '''Test inheritance between entities'''
     ent1 = BaseEntity(name='parent', target='aury[10-16]')
     ent1.fanout = 5
     ent1.errors = 2
     ent1.timeout = 15
     ent2 = BaseEntity(name='child')
     ent2.inherits_from(ent1)
     self.assertEqual(ent2.target, NodeSet('aury[10-16]'))
     self.assertEqual(ent2.fanout, 5)
     self.assertEqual(ent2.errors, 2)
     self.assertEqual(ent2.timeout, 15)
Example #8
0
 def test_inheritance_of_properties1(self):
     '''Test inheritance between entities'''
     ent1 = BaseEntity(name='parent', target='aury[10-16]')
     ent1.fanout = 5
     ent1.errors = 2
     ent1.timeout = 15
     ent2 = BaseEntity(name='child')
     ent2.inherits_from(ent1)
     self.assertEqual(ent2.target, NodeSet('aury[10-16]'))
     self.assertEqual(ent2.fanout, 5)
     self.assertEqual(ent2.errors, 2)
     self.assertEqual(ent2.timeout, 15)
Example #9
0
 def inherits_from(self, entity):
     '''Inherit properties from entity'''
     BaseEntity.inherits_from(self, entity)
     for action in self.iter_actions():
         action.inherits_from(self)
Example #10
0
 def inherits_from(self, entity):
     '''Inherit properties from entity'''
     BaseEntity.inherits_from(self, entity)
     for subservice in self.iter_subservices():
         subservice.inherits_from(self)
Example #11
0
 def inherits_from(self, entity):
     '''Inherit properties from entity'''
     BaseEntity.inherits_from(self, entity)
     for subservice in self.iter_subservices():
         subservice.inherits_from(self)
Example #12
0
 def inherits_from(self, entity):
     """Inherit properties from entity"""
     BaseEntity.inherits_from(self, entity)
     for action in self.iter_actions():
         action.inherits_from(self)