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