<s> from test import CollectorTestCase <EOL> from test import get_collector_config <EOL> from test import unittest <EOL> from mock import patch <EOL> from diamond . collector import Collector <EOL> from example import ExampleCollector <EOL> class TestExampleCollector ( CollectorTestCase ) : <EOL> def setUp ( self ) : <EOL> config = get_collector_config ( '<STR_LIT>' , { <EOL> '<STR_LIT>' : <NUM_LIT:10> <EOL> } ) <EOL> self . collector = ExampleCollector ( config , None ) <EOL> def test_import ( self ) : <EOL> self . assertTrue ( ExampleCollector ) <EOL> @ patch . object ( Collector , '<STR_LIT>' ) <EOL> def test ( self , publish_mock ) : <EOL> self . collector . collect ( ) <EOL> metrics = { <EOL> '<STR_LIT>' : <NUM_LIT> <EOL> } <EOL> self . setDocExample ( collector = self . collector . __class__ . __name__ , <EOL> metrics = metrics , <EOL> defaultpath = self . collector . config [ '<STR_LIT:path>' ] ) <EOL> self . assertPublishedMany ( publish_mock , metrics ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
