<filename>test/unit/agent/data/statsd.py
# -*- coding: utf-8 -*-
from hamcrest import *

from test.base import BaseTestCase
from amplify.agent.data.statsd import StatsdClient

__author__ = "<NAME>"
__copyright__ = "Copyright (C) Nginx Inc. All rights reserved."
__license__ = ""
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"


class StatsdClientTestCase(BaseTestCase):

    def test_incr_negative_amount(self):
        client = StatsdClient()

        client.incr('test_positive', value=100)
        assert_that(len(client.current['counter']), equal_to(1))  # check that we saved the value

        client.incr('test_negative', value=-200)
        assert_that(len(client.current['counter']), equal_to(1))  # we did't add negative metric

<filename>test/unit/agent/data/statsd.py
# -*- coding: utf-8 -*-
from hamcrest import *

from test.base import BaseTestCase
from amplify.agent.data.statsd import StatsdClient

__author__ = "<NAME>"
__copyright__ = "Copyright (C) Nginx Inc. All rights reserved."
__license__ = ""
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"


class StatsdClientTestCase(BaseTestCase):

    def test_incr_negative_amount(self):
        client = StatsdClient()

        client.incr('test_positive', value=100)
        assert_that(len(client.current['counter']), equal_to(1))  # check that we saved the value

        client.incr('test_negative', value=-200)
        assert_that(len(client.current['counter']), equal_to(1))  # we did't add negative metric

# -*- coding: utf-8 -*- # check that we saved the value # we did't add negative metric