Ejemplo n.º 1
0
 def test_decr_with_tag(self):
     with pytest.raises(ValueError):
         statsdecor.decr('a.metric', tags=self.tags)
Ejemplo n.º 2
0
 def test_decr_with_tag(self, mocked_super):
     statsdecor.decr('a.metric', tags=self.tags)
     mocked_super.assert_called_with(metric='a.metric',
                                     value=DEFAULT_VALUE,
                                     tags=self.tags,
                                     sample_rate=DEFAULT_RATE)
Ejemplo n.º 3
0
 def test_decr_no_tag(self, mocked_super):
     statsdecor.decr('a.metric')
     mocked_super.assert_called_with(stat='a.metric',
                                     count=DEFAULT_VALUE,
                                     rate=DEFAULT_RATE)
Ejemplo n.º 4
0
def test_decr__with_value_and_rate():
    with stub_client() as stub:
        statsdecor.decr('a.metric', 9, 0.1)
        stub.client.decr.assert_called_with('a.metric', 9, 0.1)
Ejemplo n.º 5
0
def test_decr():
    with stub_client() as stub:
        statsdecor.decr('a.metric')
        stub.client.decr.assert_called_with('a.metric', 1, 1)
Ejemplo n.º 6
0
def test_decr__with_value_and_rate():
    with stub_client() as stub:
        statsdecor.decr('a.metric', 9, 0.1)
        stub.client.decr.assert_called_with('a.metric', 9, 0.1)
Ejemplo n.º 7
0
def test_decr():
    with stub_client() as stub:
        statsdecor.decr('a.metric')
        stub.client.decr.assert_called_with('a.metric', 1, 1)