<s> """<STR_LIT>""" <EOL> from mock import patch <EOL> from . utils import ok_startswith , eq_ , ignore_nose_capturing_stdout , assert_cwd_unchanged <EOL> from datalad . cmd import Runner <EOL> from datalad . support . exceptions import CommandError <EOL> def check_run_and_get_output ( cmd ) : <EOL> runner = Runner ( ) <EOL> try : <EOL> with patch . dict ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) : <EOL> output = runner . run ( [ "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> except CommandError as e : <EOL> raise AssertionError ( "<STR_LIT>" <EOL> "<STR_LIT>" % ( e . code , ( e . stdout , e . stderr ) ) ) <EOL> return output <EOL> @ ignore_nose_capturing_stdout <EOL> @ assert_cwd_unchanged <EOL> def test_run_datalad_help ( ) : <EOL> out , err = check_run_and_get_output ( "<STR_LIT>" ) <EOL> ok_startswith ( out , "<STR_LIT>" ) <EOL> eq_ ( err , "<STR_LIT>" ) </s>
