EastAgile / robber.py

BDD / TDD assertion library for Python
MIT License
8 stars 1 forks source link

String compare to unicode #12

Closed hieueastagile closed 7 years ago

hieueastagile commented 7 years ago

Same as: https://github.com/vesln/robber.py/issues/9, also an issue which is described in pandoodle-scrapy

catriuspham commented 7 years ago

I couldn't reproduce this issue. I tried:

expect(u'Một con mèo').to.eq('Một con mèo')
expect(u'Cat').to.eq('Cat')

Both passed.

hieueastagile commented 7 years ago

It's not the matter of comparing unicode, but the unicode inside a hash/list, please check two links that I included above @catriuspham

catriuspham commented 7 years ago

Ah, I just found out that this issue only occurs in Python 2.

catriuspham commented 7 years ago

@hieueastagile Do you want to deal with multi-level list/dict with unicode string too? For example, this should pass:

s_list = [
    ['Mèo']
]
u_list = [
    [u'Mèo']
]
expect(s_list).to.eq(u_list)