def test_missing_aws_stack(mocked_aws_cf_simple, monkeypatch):
 monkeypatch.setattr(test_util.aws.CfStack, '__init__', mock_stack_not_found)
 config = yaml.safe_load(mocked_aws_cf_simple)
 aws_launcher = get_launcher(config['type'], config['provider_info'])
 def check_stack_error(cmd, args):
  with pytest.raises(LauncherError) as exinfo:
   getattr(aws_launcher, cmd)(*args)
  assert (exinfo.value.error == 'StackNotFound')
 info = aws_launcher.create(config)
 check_stack_error('wait', (info,))
 check_stack_error('describe', (info,))
 check_stack_error('delete', (info,))
 check_stack_error('test', (info, 'py.test'))

def test_missing_aws_stack ( mocked_aws_cf_simple , monkeypatch ) : monkeypatch . setattr ( test_util . aws . CfStack , '__init__' , mock_stack_not_found ) config = yaml . safe_load ( mocked_aws_cf_simple ) aws_launcher = get_launcher ( config [ 'type' ] , config [ 'provider_info' ] ) def check_stack_error ( cmd , args ) : with pytest . raises ( LauncherError ) as exinfo : getattr ( aws_launcher , cmd ) ( * args ) assert ( exinfo . value . error == 'StackNotFound' ) info = aws_launcher . create ( config ) check_stack_error ( 'wait' , ( info , ) ) check_stack_error ( 'describe' , ( info , ) ) check_stack_error ( 'delete' , ( info , ) ) check_stack_error ( 'test' , ( info , 'py.test' ) )
tests that clean and appropriate errors will be raised .