コード例 #1
0
 def test_apply(self, apply_items, NodeLock, ApplyResult):
     repo = Repository()
     n = Node("node1", {})
     repo.add_node(n)
     result = MagicMock()
     ApplyResult.return_value = result
     NodeLock.__enter__ = lambda x: x
     NodeLock.__exit__ = lambda x: x
     self.assertEqual(n.apply(), result)
     self.assertEqual(apply_items.call_count, 1)
     ApplyResult.assert_called_once()
コード例 #2
0
 def apply(self, interactive=False, workers=4, force=False, profiling=False):
     assert interactive
     result = ApplyResult(self, ())
     result.start = datetime(2013, 8, 10, 0, 0)
     result.end = datetime(2013, 8, 10, 0, 1)
     return result