def testIntersect_Disjoint(self): a = SourceSet(set(['a', 'b']), set([SourceListCondition('1', '2', '3')])) b = SourceSet(set(['c', 'd']), set([SourceListCondition('3', '4', '6')])) c = a.Intersect(b) self.assertEqual(c.sources, set()) self.assertEqual( c.conditions, set([ SourceListCondition('1', '2', '3'), SourceListCondition('3', '4', '6') ])) self.assertTrue(c.IsEmpty())
def testIntersect_Overlap(self): a = SourceSet(set(['a', 'b']), set([SourceListCondition('1', '2', '3')])) b = SourceSet(set(['b', 'c']), set([SourceListCondition('3', '4', '6')])) c = a.Intersect(b) self.assertEqual(c.sources, set(['b'])) self.assertEqual( c.conditions, set([ SourceListCondition('1', '2', '3'), SourceListCondition('3', '4', '6') ])) self.assertFalse(c.IsEmpty())