Ejemplo n.º 1
0
 def setUp(self):
     self.list = patterns.ObservableList(
         [DummyItem('a'),
          DummyItem('b'),
          DummyItem('c'),
          DummyItem('d')])
     self.filter1 = DummyFilter(self.list)
     self.filter2 = TestFilter(self.filter1)
Ejemplo n.º 2
0
 def setUp(self):
     self.list = patterns.ObservableList()
     self.observer = patterns.ListDecorator(self.list)
     patterns.Publisher().registerObserver(self.onAdd, 
         eventType=self.observer.addItemEventType(),
         eventSource=self.observer)
     patterns.Publisher().registerObserver(self.onRemove,
         eventType=self.observer.removeItemEventType(),
         eventSource=self.observer)
     self.receivedAddEvents = []
     self.receivedRemoveEvents = []
Ejemplo n.º 3
0
 def setUp(self):
     self.observable = patterns.ObservableList()
     self.observer = patterns.SetDecorator(self.observable)
     self.observable.extend([1, 2, 3])
Ejemplo n.º 4
0
 def setUp(self):
     self.observable = patterns.ObservableList()
     self.observer = patterns.SetDecorator(self.observable)
Ejemplo n.º 5
0
 def testOriginalNotEmpty(self):
     observable = patterns.ObservableList([1, 2, 3])
     observer = patterns.ListDecorator(observable)
     self.assertEqual([1, 2, 3], observer)
Ejemplo n.º 6
0
 def createObservableCollection(self):
     return patterns.ObservableList()