Beispiel #1
0
    def test_GetProbes(self, mock_get_probe_data):
        TestProbing.test_GetProbes(self)

        probes = self.get_probes_object()
        metadata = Mock()
        probes.GetProbes(metadata)
        mock_get_probe_data.assert_called_with(metadata)
Beispiel #2
0
    def test_ReceiveData(self, mock_ReceiveDataItem, mock_write_data):
        TestProbing.test_ReceiveData(self)

        # we use a simple (read: bogus) datalist here to make this
        # easy to test
        datalist = ["a", "b", "c"]
        
        probes = self.get_probes_object()
        client = Mock()
        client.hostname = "foo.example.com"
        probes.ReceiveData(client, datalist)
        
        self.assertItemsEqual(mock_ReceiveDataItem.call_args_list,
                              [call(client, "a"), call(client, "b"),
                               call(client, "c")])
        mock_write_data.assert_called_with(client)