Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
    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)
Пример #4
0
    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)
Пример #5
0
 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ó'])
Пример #6
0
 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')
Пример #7
0
 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ó'])
Пример #8
0
 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')