def test_newline(self):
     self.assertEqual(refactor('print 1\n'), 'print(1)\n')
 def test_file(self):
     self.assertEqual(refactor('print >>f, 1'), 'print(1, file=f)')
 def test_end(self):
     self.assertEqual(refactor('print 1,'), "print(1, end=' ')")
Esempio n. 4
0
 def test_multiple(self):
     self.assertEqual(refactor('print 1, 2, 3'), 'print(1, 2, 3)')
 def test_multiple(self):
     self.assertEqual(refactor('print 1, 2, 3'), 'print(1, 2, 3)')
 def test_multiline_string(self):
     self.assertEqual(refactor('print """\n1"""'), 'print("""\n1""")')
 def test_function(self):
     self.assertEqual(refactor('def f():\n print 1'), 'def f():\n print(1)')
Esempio n. 8
0
 def test_multiline_string(self):
     self.assertEqual(refactor('print """\n1"""'), 'print("""\n1""")')
Esempio n. 9
0
 def test_condition(self):
     self.assertEqual(refactor('if True:\n print 1'), 'if True:\n print(1)')
Esempio n. 10
0
 def test_continued(self):
     self.assertEqual(refactor('print 1,\\\n2'), 'print(1,\\\n2)')
Esempio n. 11
0
 def test_multiline(self):
     self.assertEqual(refactor('print (\n1)'), 'print((\n1))')
Esempio n. 12
0
 def test_newline(self):
     self.assertEqual(refactor('print 1\n'), 'print(1)\n')
Esempio n. 13
0
 def test_end(self):
     self.assertEqual(refactor('print 1,'), "print(1, end=' ')")
Esempio n. 14
0
 def test_file(self):
     self.assertEqual(refactor('print >>f, 1'), 'print(1, file=f)')
 def test_continued(self):
     self.assertEqual(refactor('print 1,\\\n2'), 'print(1,\\\n2)')
Esempio n. 16
0
 def test_function(self):
     self.assertEqual(refactor('def f():\n print 1'), 'def f():\n print(1)')
 def test_multiline(self):
     self.assertEqual(refactor('print (\n1)'), 'print((\n1))')
Esempio n. 18
0
 def test_class(self):
     self.assertEqual(refactor('class F:\n print 1'), 'class F:\n print(1)')
 def test_condition(self):
     self.assertEqual(refactor('if True:\n print 1'), 'if True:\n print(1)')
 def test_simple(self):
     self.assertEqual(refactor('print 1'), 'print(1)')
 def test_class(self):
     self.assertEqual(refactor('class F:\n print 1'), 'class F:\n print(1)')
Esempio n. 22
0
 def test_simple(self):
     self.assertEqual(refactor('print 1'), 'print(1)')