Changeset 785 for trunk/tests


Ignore:
Timestamp:
Jan 26, 2016, 12:50:41 PM (3 years ago)
Author:
cito
Message:

Make all tests run again with Python 3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/test_classic_functions.py

    r781 r785  
    221221        self.assertEqual(f('{}'), [])
    222222        self.assertEqual(f('{}', None), [])
    223         self.assertEqual(f('{}', None, ';'), [])
     223        self.assertEqual(f('{}', None, b';'), [])
    224224        self.assertEqual(f('{}', str), [])
    225         self.assertEqual(f('{}', str, ';'), [])
     225        self.assertEqual(f('{}', str, b';'), [])
    226226
    227227    def testParserSimple(self):
     
    293293        f = pg.cast_array
    294294        self.assertEqual(f('{1,2}'), ['1', '2'])
    295         self.assertEqual(f('{1,2}', delim=','), ['1', '2'])
     295        self.assertEqual(f('{1,2}', delim=b','), ['1', '2'])
    296296        self.assertEqual(f('{1;2}'), ['1;2'])
    297         self.assertEqual(f('{1;2}', delim=';'), ['1', '2'])
    298         self.assertEqual(f('{1,2}', delim=';'), ['1,2'])
     297        self.assertEqual(f('{1;2}', delim=b';'), ['1', '2'])
     298        self.assertEqual(f('{1,2}', delim=b';'), ['1,2'])
    299299
    300300    def testParserWithData(self):
     
    321321
    322322        def replace_comma(value):
    323             if isinstance(value, basestring):
     323            if isinstance(value, str):
    324324                return value.replace(',', ';')
    325325            elif isinstance(value, list):
     
    334334            else:
    335335                expected = replace_comma(expected)
    336                 self.assertEqual(f(expression, cast, ';'), expected)
     336                self.assertEqual(f(expression, cast, b';'), expected)
    337337
    338338
Note: See TracChangeset for help on using the changeset viewer.