예제 #1
0
 def test_update_index2_add(self):
     v = {'a': 42}
     index2 = mock.Mock()
     self.tspace.add_index(self.index)
     self.tspace.add_index(index2)
     tid = self.tspace.put(v)
     self.index.assert_has_calls([call.add_tuple(tid, v)])
     index2.assert_has_calls([call.add_tuple(tid, v)])
예제 #2
0
 def test_update_index_remove(self):
     v = {'a': 42}
     self.tspace.add_index(self.index)
     tid = self.tspace.put(v)
     self.tspace.remove(tid)
     self.index.assert_has_calls(
         [call.add_tuple(tid, v),
          call.remove_tuple(tid, v)])
예제 #3
0
 def test_add_index_contents(self):
     v = {'a': 42}
     tid1 = self.tspace.put(v)
     tid2 = self.tspace.put(v)
     tid3 = self.tspace.put(v)
     self.tspace.add_index(self.index)
     calls = [call.add_tuple(t, v) for t in [tid1, tid2, tid3]]
     self.index.assert_has_calls(calls)