コード例 #1
0
    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)
コード例 #2
0
 def test_with_open_api_bad_value(self):
     api = SamApi("foo")
     api.OpenApiVersion = "5.0"
     with pytest.raises(InvalidResourceException):
         api.to_cloudformation(**self.kwargs)