예제 #1
0
 def test_set_endpoint_no_notify(self):
     n = Monitorable()
     parent = Mock()
     endpoint = Mock()
     # Check that the mock looks like it is serializable
     self.assertTrue(hasattr(endpoint, "to_dict"))
     n.set_parent(parent, "test_n")
     n.endpoints = ["end"]
     n.set_endpoint_data("end", endpoint, notify=False)
     self.assertEqual(n.end, endpoint)
     self.assertEqual(parent.report_changes.called, False)
예제 #2
0
 def test_set_endpoint_no_notify(self):
     n = Monitorable()
     parent = Mock()
     endpoint = Mock()
     # Check that the mock looks like it is serializable
     self.assertTrue(hasattr(endpoint, "to_dict"))
     n.set_process_path(parent, ("test_n",))
     n.endpoints = ["end"]
     n.set_endpoint_data("end", endpoint, notify=False)
     self.assertEqual(n.end, endpoint)
     self.assertEqual(parent.report_changes.called, False)
예제 #3
0
 def test_set_endpoint(self):
     n = Monitorable()
     parent = Mock()
     endpoint = Mock()
     # Check that the mock looks like it is serializable
     self.assertTrue(hasattr(endpoint, "to_dict"))
     n.set_parent(parent, "test_n")
     n.endpoints = ["end"]
     n.set_endpoint_data("end", endpoint, notify=True)
     self.assertEqual(n.end, endpoint)
     parent.report_changes.assert_called_once_with([["test_n", "end"],
                                                    endpoint.to_dict()])
예제 #4
0
 def test_set_endpoint(self):
     n = Monitorable()
     parent = Mock()
     endpoint = Mock()
     # Check that the mock looks like it is serializable
     self.assertTrue(hasattr(endpoint, "to_dict"))
     n.set_process_path(parent, ["test_n"])
     n.endpoints = ["end"]
     n.set_endpoint_data("end", endpoint, notify=True)
     self.assertEqual(n.end, endpoint)
     parent.report_changes.assert_called_once_with(
         [["test_n", "end"], endpoint.to_dict()])