-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Grandchildren of Route was not inheriting callable arguments (#114)
- Loading branch information
Showing
3 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from inori import Route | ||
|
||
|
||
def test_update_url(client): | ||
""" | ||
Given a Route has children | ||
When Route._update_url is called | ||
Then the Route and it's children are updated | ||
And the children of the children are updated | ||
""" | ||
route = Route(client, 'johnathan/${cId}/joseph/holly') | ||
child_route = Route(client, 'johnathan/${cId}/joseph/holly/jotaro') | ||
grandchild_route = Route( | ||
client, 'johnathan/${cId}/joseph/holly/jotaro/jolyne', | ||
) | ||
|
||
route.children = {'jotaro': child_route} | ||
child_route.children = {'jolyne': grandchild_route} | ||
|
||
route._update_url({'cId': '5'}) | ||
|
||
assert route.url == 'johnathan/5/joseph/holly' | ||
assert child_route.url == 'johnathan/5/joseph/holly/jotaro' | ||
assert grandchild_route.url == 'johnathan/5/joseph/holly/jotaro/jolyne' |