robber.py
robber.py copied to clipboard
equal not work properly when compare str with unicode
The following code snippet demonstrates the issue(run on OSX):
from robber import expect
import json
abc=json.loads('{"a": "abc"}')
expect(abc['a']).to.equal('abc')
Run the above will generate the following exception message:
BadExpectation: u'Expected "abc" to be "abc"'
If I replace equal to eq(namely, expect(abc['a']).to.eq('abc')), then it works
Sorry, forgot to mention that I'm using python 2.7
@tiger-flying Actually, the right expectation should be:
expect(abc['a']).to.eq('abc')
equal
just use for checking identical