Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New template object uses expand function
- Loading branch information
1 parent
0f892e4
commit 4876938
Showing
3 changed files
with
20 additions
and
39 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,12 @@ | ||
from unittest import TestCase | ||
|
||
import purl | ||
|
||
|
||
class TemplateTests(TestCase): | ||
|
||
def test_basic_expansion(self): | ||
template = purl.Template('http://example.com{+path,x}/here') | ||
url = template.expand({'path': '/foo/bar', 'x': 1024}) | ||
self.assertEquals('http://example.com/foo/bar,1024/here', | ||
url.as_string()) |