예제 #1
0
 def test_match_notify_false(self):
     # Test the top-level function
     expr = expression.match(filter=self.anytrait, notify=False)
     expected = [
         create_graph(
             FilteredTraitObserver(filter=self.anytrait, notify=False), ),
     ]
     actual = expr._as_graphs()
     self.assertEqual(actual, expected)
예제 #2
0
 def test_match_method_notify_true(self):
     # Test the instance method calls the top-level function correctly.
     expr = expression.match(filter=self.anytrait).match(
         filter=self.anytrait)
     expected = [
         create_graph(
             FilteredTraitObserver(filter=self.anytrait, notify=True),
             FilteredTraitObserver(filter=self.anytrait, notify=True),
         ),
     ]
     actual = expr._as_graphs()
     self.assertEqual(actual, expected)