<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import dtrace <EOL> import unittest <EOL> SCRIPT = '<STR_LIT>' <EOL> class TestDTraceConsumer ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . out = '<STR_LIT>' <EOL> self . consumer = dtrace . DTraceConsumer ( out_func = self . _get_output ) <EOL> def test_compile_for_success ( self ) : <EOL> self . consumer . compile ( SCRIPT ) <EOL> def test_run_for_success ( self ) : <EOL> self . consumer . run ( SCRIPT ) <EOL> def test_compile_for_failure ( self ) : <EOL> self . assertRaises ( Exception , self . consumer . compile , '<STR_LIT:foo>' ) <EOL> def test_run_for_failure ( self ) : <EOL> self . assertRaises ( Exception , self . consumer . run , '<STR_LIT>' ) <EOL> def test_run_for_sanity ( self ) : <EOL> self . consumer . run ( SCRIPT ) <EOL> self . assertEquals ( '<STR_LIT>' , self . out ) <EOL> def _get_output ( self , tmp ) : <EOL> self . out = tmp </s>
