Example #1
0
 def test_some_zero_values(self):
     self.client = ClientBase()
     self.client.send = mock.Mock()
     self.client.metric('some_series', {
         'value_one': 1,
         'value_zero': 0,
         'value_none': None
     })
     self.client.send.assert_called_with(
         'some_series value_one=1i,value_zero=0i')
Example #2
0
class TestClientBase(unittest.TestCase):
    def test_zero_value(self):
        self.client = ClientBase()
        self.client.send = mock.Mock()
        self.client.metric('some_series', 0)
        self.client.send.assert_called_with('some_series value=0i')

    def test_null_value(self):
        self.client = ClientBase()
        self.client.send = mock.Mock()
        self.client.metric('some_series', None)
        self.assertEqual(self.client.send.call_count, 0)

    def test_empty_values_dict(self):
        self.client = ClientBase()
        self.client.send = mock.Mock()
        self.client.metric('some_series', {})
        self.assertEqual(self.client.send.call_count, 0)

    def test_some_zero_values(self):
        self.client = ClientBase()
        self.client.send = mock.Mock()
        self.client.metric('some_series', {
            'value_one': 1,
            'value_zero': 0,
            'value_none': None
        })
        self.client.send.assert_called_with(
            'some_series value_one=1i,value_zero=0i')
Example #3
0
 def test_empty_values_dict(self):
     self.client = ClientBase()
     self.client.send = mock.Mock()
     self.client.metric('some_series', {})
     self.assertEqual(self.client.send.call_count, 0)
Example #4
0
 def test_null_value(self):
     self.client = ClientBase()
     self.client.send = mock.Mock()
     self.client.metric('some_series', None)
     self.assertEqual(self.client.send.call_count, 0)
Example #5
0
 def test_zero_value(self):
     self.client = ClientBase()
     self.client.send = mock.Mock()
     self.client.metric('some_series', 0)
     self.client.send.assert_called_with('some_series value=0i')