<s> import os <EOL> import json <EOL> from test import CollectorTestCase <EOL> from test import get_collector_config <EOL> from test import unittest <EOL> from diamond . collector import Collector <EOL> from fluentd import FluentdCollector <EOL> dirname = os . path . dirname ( __file__ ) <EOL> fixtures_path = os . path . join ( dirname , '<STR_LIT>' ) <EOL> class TestFluentdCollector ( CollectorTestCase ) : <EOL> def setUp ( self ) : <EOL> config = get_collector_config ( '<STR_LIT>' , { <EOL> '<STR_LIT>' : <NUM_LIT:10> , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] <EOL> } <EOL> } ) <EOL> self . collector = FluentdCollector ( config , None ) <EOL> def test_import ( self ) : <EOL> self . assertTrue ( FluentdCollector ) <EOL> def test_api_output_parse ( self ) : <EOL> f = open ( os . path . join ( fixtures_path , "<STR_LIT>" ) ) . read ( ) <EOL> stat = json . loads ( f ) <EOL> self . assertTrue ( len ( self . collector . parse_api_output ( stat ) ) is <NUM_LIT:3> ) <EOL> def test_api_output_parse_empty ( self ) : <EOL> f = open ( os . path . join ( fixtures_path , "<STR_LIT>" ) ) . read ( ) <EOL> stat = json . loads ( f ) <EOL> self . assertTrue ( len ( self . collector . parse_api_output ( stat ) ) is <NUM_LIT:0> ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
