def test_with_open_api_3_no_stage(self): api = SamApi("foo") api.OpenApiVersion = "3.0" resources = api.to_cloudformation(**self.kwargs) deployment = [ x for x in resources if isinstance(x, ApiGatewayDeployment) ] self.assertEqual(deployment.__len__(), 1) self.assertEqual(deployment[0].StageName, None)
def test_with_open_api_bad_value(self): api = SamApi("foo") api.OpenApiVersion = "5.0" with pytest.raises(InvalidResourceException): api.to_cloudformation(**self.kwargs)