コード例 #1
0
 def test_ReturnsCorrectRelationships(self):
     c = self.zp.addComponentType('SampleComponent')
     r = Relationship(self.zp, 'SampleDevice', 'SampleComponent')
     self.assertEqual([r], Relationship.find(c))
     self.assertEqual([], Relationship.find(c, types='1-M'))
     self.assertEqual([r], Relationship.find(c, types=['1-M', 'M-M']))
     self.assertEqual([], Relationship.find(c, types=['1-1']))
コード例 #2
0
 def test_ReturnsCorrectRelationships(self):
     c = self.zp.addComponentType('SampleComponent')
     r = Relationship(self.zp, 'SampleDevice', 'SampleComponent')
     self.assertEqual([r], Relationship.find(c))
     self.assertEqual([], Relationship.find(c, types='1-M'))
     self.assertEqual([r], Relationship.find(c, types=['1-M', 'M-M']))
     self.assertEqual([], Relationship.find(c, types=['1-1']))
コード例 #3
0
 def test_ReturnsContainedRelationships(self):
     c = Component(self.zp, 'SampleComponent')
     c3 = Component(self.zp, 'SampleComponent3')
     r = Relationship(self.zp, 'SampleDevice', 'SampleComponent')
     r3 = Relationship(
         self.zp, 'SampleComponent3', 'SampleComponent4', contained=False)
     Relationship(self.zp, 'SampleComponent4', 'SampleComponent5')
     self.maxDiff = None
     self.assertEqual([r], Relationship.find(c, contained=True))
     self.assertEqual([r3], Relationship.find(c3, contained=False))
コード例 #4
0
 def test_ReturnsContainedRelationships(self):
     c = Component(self.zp, 'SampleComponent')
     c3 = Component(self.zp, 'SampleComponent3')
     r = Relationship(self.zp, 'SampleDevice', 'SampleComponent')
     r3 = Relationship(self.zp,
                       'SampleComponent3',
                       'SampleComponent4',
                       contained=False)
     Relationship(self.zp, 'SampleComponent4', 'SampleComponent5')
     self.maxDiff = None
     self.assertEqual([r], Relationship.find(c, contained=True))
     self.assertEqual([r3], Relationship.find(c3, contained=False))
コード例 #5
0
 def test_ReturnsNoRelationships(self):
     c2 = self.zp.addComponentType('SampleComponent2')
     Relationship(self.zp, 'SampleDevice', 'SampleComponent')
     self.maxDiff = None
     self.assertEqual([], Relationship.find(c2))
コード例 #6
0
 def test_ReturnsNoRelationships(self):
     c2 = self.zp.addComponentType('SampleComponent2')
     Relationship(self.zp, 'SampleDevice', 'SampleComponent')
     self.maxDiff = None
     self.assertEqual([], Relationship.find(c2))