Skip to content

Commit

Permalink
tests: add load routes tests with default and specific gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis-Henrique committed Nov 28, 2023
1 parent 0e301f8 commit 4f56f69
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,23 @@ def test_initialization_without_template_exception(self):
SAM()

def load_routes_from_cloudformation(self):
sam = SAM(f"{self.path_templates}/example2.yml")
routes = sam.load_routes_from_cloudformation()

expected_routes = {
"ApiGateway": {
"/hello": {
"GET": {
"name": "hello_world_function",
"handler": "app.lambda_handler",
},
}
}
}

self.assertDictEqual(dict(routes), expected_routes)

def load_routes_from_cloudformation_with_default_gateway(self):
sam = SAM(f"{self.path_templates}/example1.yml")
routes = sam.load_routes_from_cloudformation()

Expand Down

0 comments on commit 4f56f69

Please sign in to comment.