@@ -672,33 +672,32 @@ def test_similar_dynamic_routes():
672
672
app = ApiGatewayResolver ()
673
673
event = deepcopy (LOAD_GW_EVENT )
674
674
675
+ # WHEN
675
676
# r'^/accounts/(?P<account_id>\\w+\\b)$' # noqa: E800
676
677
@app .get ("/accounts/<account_id>" )
677
678
def get_account (account_id : str ):
678
679
assert account_id == "single_account"
679
- return {"message" : f"{ account_id } " }
680
680
681
681
# r'^/accounts/(?P<account_id>\\w+\\b)/source_networks$' # noqa: E800
682
682
@app .get ("/accounts/<account_id>/source_networks" )
683
683
def get_account_networks (account_id : str ):
684
684
assert account_id == "nested_account"
685
- return {"message" : f"{ account_id } " }
686
685
687
686
# r'^/accounts/(?P<account_id>\\w+\\b)/source_networks/(?P<network_id>\\w+\\b)$' # noqa: E800
688
687
@app .get ("/accounts/<account_id>/source_networks/<network_id>" )
689
688
def get_network_account (account_id : str , network_id : str ):
690
689
assert account_id == "nested_account"
691
690
assert network_id == "network"
692
- return {"message" : f"{ account_id } " }
693
-
694
- event ["resource" ] = "/accounts/{account_id}/source_networks"
695
- event ["path" ] = "/accounts/nested_account/source_networks"
696
- app .resolve (event , None )
697
691
692
+ # THEN
698
693
event ["resource" ] = "/accounts/{account_id}"
699
694
event ["path" ] = "/accounts/single_account"
700
695
app .resolve (event , None )
701
696
697
+ event ["resource" ] = "/accounts/{account_id}/source_networks"
698
+ event ["path" ] = "/accounts/nested_account/source_networks"
699
+ app .resolve (event , None )
700
+
702
701
event ["resource" ] = "/accounts/{account_id}/source_networks/{network_id}"
703
702
event ["path" ] = "/accounts/nested_account/source_networks/network"
704
703
app .resolve (event , {})
0 commit comments