Ejemplo n.º 1
0
 def test_fix_code_should_throw_error_without_yapf_installed(self):
     yapf = yapfutil.yapf_api
     yapfutil.yapf_api = None
     src = 'x=       123\n', 'x = 123\n'
     with self.assertRaises(Fault):
         yapfutil.fix_code(src, os.getcwd())
     yapfutil.yapf_api = yapf
Ejemplo n.º 2
0
 def _assert_format(self, src, expected):
     new_block = yapfutil.fix_code(src, os.getcwd())
     self.assertEqual(new_block, expected)
Ejemplo n.º 3
0
 def _assert_format(self, src, expected):
     new_block = yapfutil.fix_code(src)
     self.assertEqual(new_block, expected)