-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parts: Split out extend(), fix a bug, and test.
So that it won't happen again.
- Loading branch information
1 parent
1fec54e
commit 41947bc
Showing
2 changed files
with
48 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from unittest import TestCase | ||
|
||
from flask_holster.parts import extend | ||
|
||
class TestExtend(TestCase): | ||
|
||
def test_extend_standard(self): | ||
i = "/standard" | ||
o = "/standard.<ext>" | ||
self.assertEqual(extend(i), o) | ||
|
||
def test_extend_params(self): | ||
i = "/<params>" | ||
o = "/<params>.<ext>" | ||
self.assertEqual(extend(i), o) | ||
|
||
def test_extend_root(self): | ||
i = "/" | ||
o = "/.<ext>" | ||
self.assertEqual(extend(i), o) | ||
|
||
def test_extend_directory(self): | ||
i = "/dir/" | ||
o = "/dir.<ext>/" | ||
self.assertEqual(extend(i), o) |