<s> from test import unittest <EOL> from diamond . metric import Metric <EOL> class TestMetric ( unittest . TestCase ) : <EOL> def testgetPathPrefix ( self ) : <EOL> metric = Metric ( '<STR_LIT>' , <EOL> <NUM_LIT:0> , <EOL> host = '<STR_LIT>' ) <EOL> actual_value = metric . getPathPrefix ( ) <EOL> expected_value = '<STR_LIT>' <EOL> message = '<STR_LIT>' % ( actual_value , expected_value ) <EOL> self . assertEqual ( actual_value , expected_value , message ) <EOL> def testgetCollectorPath ( self ) : <EOL> metric = Metric ( '<STR_LIT>' , <EOL> <NUM_LIT:0> , <EOL> host = '<STR_LIT>' ) <EOL> actual_value = metric . getCollectorPath ( ) <EOL> expected_value = '<STR_LIT>' <EOL> message = '<STR_LIT>' % ( actual_value , expected_value ) <EOL> self . assertEqual ( actual_value , expected_value , message ) <EOL> def testgetMetricPath ( self ) : <EOL> metric = Metric ( '<STR_LIT>' , <EOL> <NUM_LIT:0> , <EOL> host = '<STR_LIT>' ) <EOL> actual_value = metric . getMetricPath ( ) <EOL> expected_value = '<STR_LIT>' <EOL> message = '<STR_LIT>' % ( actual_value , expected_value ) <EOL> self . assertEqual ( actual_value , expected_value , message ) <EOL> def testgetPathPrefixHostNone ( self ) : <EOL> metric = Metric ( '<STR_LIT>' , <EOL> <NUM_LIT:0> ) <EOL> actual_value = metric . getPathPrefix ( ) <EOL> expected_value = '<STR_LIT>' <EOL> message = '<STR_LIT>' % ( actual_value , expected_value ) <EOL> self . assertEqual ( actual_value , expected_value , message ) <EOL> def testgetCollectorPathHostNone ( self ) : <EOL> metric = Metric ( '<STR_LIT>' , <EOL> <NUM_LIT:0> ) <EOL> actual_value = metric . getCollectorPath ( ) <EOL> expected_value = '<STR_LIT>' <EOL> message = '<STR_LIT>' % ( actual_value , expected_value ) <EOL> self . assertEqual ( actual_value , expected_value , message ) <EOL> def testgetMetricPathHostNone ( self ) : <EOL> metric = Metric ( '<STR_LIT>' , <EOL> <NUM_LIT:0> ) <EOL> actual_value = metric . getMetricPath ( ) <EOL> expected_value = '<STR_LIT>' <EOL> message = '<STR_LIT>' % ( actual_value , expected_value ) <EOL> self . assertEqual ( actual_value , expected_value , message ) <EOL> def test_issue_723 ( self ) : <EOL> metrics = [ <EOL> <NUM_LIT> , <EOL> '<STR_LIT>' , <EOL> <NUM_LIT> , <EOL> '<STR_LIT>' , <EOL> ] <EOL> for precision in xrange ( <NUM_LIT:0> , <NUM_LIT:100> ) : <EOL> for m in metrics : <EOL> metric = Metric ( '<STR_LIT>' , m , timestamp = <NUM_LIT:0> ) <EOL> actual_value = str ( metric ) . strip ( ) <EOL> expected_value = '<STR_LIT>' <EOL> message = '<STR_LIT>' % ( actual_value , <EOL> expected_value ) <EOL> self . assertEqual ( actual_value , expected_value , message ) </s>
