def test_format_as_another_user_picks_the_right_exe( self, correct, wrong, system_exe): flexmock(os.path).should_receive('isfile').with_args( '/usr/libexec/da_auth').and_return(system_exe) flexmock(os).should_receive('access').with_args( '/usr/libexec/da_auth', 1).and_return(system_exe) assert correct in ClHelper.format_for_another_user('foo', 'root') assert wrong not in ClHelper.format_for_another_user('foo', 'root')
def test_format_as_another_user_picks_the_right_exe(self, correct, wrong, system_exe): flexmock(os.path).should_receive('isfile').with_args('/usr/libexec/da_auth').and_return(system_exe) flexmock(os).should_receive('access').with_args('/usr/libexec/da_auth', 1).and_return(system_exe) assert correct in ClHelper.format_for_another_user('foo', 'root') assert wrong not in ClHelper.format_for_another_user('foo', 'root')