-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from gabrielfalcao/escape-str-format-char
Correctly escape special string format charachter. Closes #134
- Loading branch information
Showing
2 changed files
with
62 additions
and
16 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,31 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
Test fix of bug described in GitHub Issue #19. | ||
""" | ||
|
||
from sure import expect | ||
|
||
|
||
def test_issue_132(): | ||
"Correctly handle % charachter in matcher string" | ||
|
||
def __great_test(): | ||
expect('hello%world').should.be.equal('hello%other') | ||
|
||
expect(__great_test).when.called.to.throw(AssertionError, "X is 'hello%world' whereas Y is 'hello%other'") | ||
|
||
def __great_test_2(): | ||
expect('hello{42}world').should.be.equal('hello{42}foo') | ||
|
||
expect(__great_test_2).when.called.to.throw(AssertionError, "X is 'hello{42}world' whereas Y is 'hello{42}foo'") | ||
|
||
def __great_test_3(): | ||
expect('hello{42world }').should.be.equal('hello{42foo }') | ||
|
||
expect(__great_test_3).when.called.to.throw(AssertionError, "X is 'hello{42world }' whereas Y is 'hello{42foo }'") | ||
|
||
def __great_test_4(): | ||
expect('hello{42world }}').should.be.equal('hello{42foo }}') | ||
|
||
expect(__great_test_4).when.called.to.throw(AssertionError, "X is 'hello{42world }}' whereas Y is 'hello{42foo }}'") |