Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_reindenter_with_non_standard_indent_size(self):
reindenter = autopep8.Reindenter('if True:\n pass\n')
self.assertEqual('if True:\n pass\n',
reindenter.run(3))
def test_reindenter_should_leave_stray_comment_alone(self):
lines = ' #\nif True:\n pass\n'
reindenter = autopep8.Reindenter(lines)
self.assertEqual(' #\nif True:\n pass\n',
reindenter.run())
def test_reindenter_with_good_input(self):
lines = 'if True:\n pass\n'
reindenter = autopep8.Reindenter(lines)
self.assertEqual(lines,
reindenter.run())
def test_reindenter(self):
reindenter = autopep8.Reindenter('if True:\n pass\n')
self.assertEqual('if True:\n pass\n',
reindenter.run())
def reindent(source, indent_size):
"""Reindent all lines."""
reindenter = Reindenter(source)
return reindenter.run(indent_size)