Esempio n. 1
0
 def test_incr_with_tag(self):
     with pytest.raises(ValueError):
         statsdecor.incr('a.metric', tags=self.tags)
Esempio n. 2
0
 def test_incr_with_tag(self, mocked_super):
     statsdecor.incr('a.metric', tags=self.tags)
     mocked_super.assert_called_with(metric='a.metric',
                                     value=DEFAULT_VALUE,
                                     tags=self.tags,
                                     sample_rate=DEFAULT_RATE)
Esempio n. 3
0
 def test_incr_no_tag(self, mocked_super):
     statsdecor.incr('a.metric')
     mocked_super.assert_called_with(stat='a.metric',
                                     count=DEFAULT_VALUE,
                                     rate=DEFAULT_RATE)
Esempio n. 4
0
def test_incr():
    with stub_client() as stub:
        statsdecor.incr('a.metric')
        stub.client.incr.assert_called_with('a.metric', 1, 1)
Esempio n. 5
0
def test_incr__with_value_and_rate():
    with stub_client() as stub:
        statsdecor.incr('a.metric', 9, 0.1)
        stub.client.incr.assert_called_with('a.metric', 9, 0.1)
Esempio n. 6
0
def test_incr():
    with stub_client() as stub:
        statsdecor.incr('a.metric')
        stub.client.incr.assert_called_with('a.metric', 1, 1)
Esempio n. 7
0
def test_incr__with_value_and_rate():
    with stub_client() as stub:
        statsdecor.incr('a.metric', 9, 0.1)
        stub.client.incr.assert_called_with('a.metric', 9, 0.1)