def test_if_unicode_dict_is_converted_to_str_dict(self): u_dict = { 'cat': u'Mèo', 'dog': u'Chó', } str_dict = { 'cat': 'Mèo', 'dog': 'Chó', } equal = Equal(u_dict, u_dict) equal.matches() self.assertEqual(equal.actual, str_dict) self.assertEqual(equal.expected, str_dict)
def test_if_ordered_dict_is_converted_to_dict(self): try: from collections import OrderedDict except ImportError: pass else: d = {'a': '1', 'b': '2', 'c': '3'} od = OrderedDict(d) equal = Equal(od, od) equal.matches() self.assertEqual(equal.actual, d) self.assertEqual(equal.expected, d)
def test_if_unicode_list_is_converted_to_str_list(self): equal = Equal([u'Mèo', u'Chó'], [u'Mèo', u'Chó']) equal.matches() self.assertEqual(equal.actual, ['Mèo', 'Chó']) self.assertEqual(equal.expected, ['Mèo', 'Chó'])
def test_if_unicode_string_is_converted_to_str(self): equal = Equal(u'Mèo', u'Mèo') equal.matches() self.assertEqual(equal.actual, 'Mèo') self.assertEqual(equal.expected, 'Mèo')