<s> from __future__ import absolute_import <EOL> from mock import patch <EOL> from sentry . metrics . statsd import StatsdMetricsBackend <EOL> from sentry . testutils import TestCase <EOL> class StatsdMetricsBackendTest ( TestCase ) : <EOL> def setUp ( self ) : <EOL> self . backend = StatsdMetricsBackend ( prefix = '<STR_LIT>' ) <EOL> @ patch ( '<STR_LIT>' ) <EOL> def test_incr ( self , mock_incr ) : <EOL> self . backend . incr ( '<STR_LIT:foo>' ) <EOL> mock_incr . assert_called_once_with ( '<STR_LIT>' , <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> @ patch ( '<STR_LIT>' ) <EOL> def test_timing ( self , mock_timing ) : <EOL> self . backend . timing ( '<STR_LIT:foo>' , <NUM_LIT:30> ) <EOL> mock_timing . assert_called_once_with ( '<STR_LIT>' , <NUM_LIT:30> , <NUM_LIT:1> ) </s>
