diff options
author | cardenb <carden@zoox.com> | 2018-05-14 22:41:56 -0700 |
---|---|---|
committer | cardenb <carden@zoox.com> | 2018-05-14 22:42:28 -0700 |
commit | 8e3169bde4574eeb801eed30314dfdd8f6ecb1a4 (patch) | |
tree | 96eb3362d584643486aae59ca259f3c6163e4c45 | |
parent | cdd68a2d8e37f87da21fa2f5c2a700a80022ac1f (diff) | |
download | yapf-8e3169bde4574eeb801eed30314dfdd8f6ecb1a4.tar.gz |
Changed some code formatting errors (irony is apparent to me here).
-rw-r--r-- | yapftests/reformatter_basic_test.py | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/yapftests/reformatter_basic_test.py b/yapftests/reformatter_basic_test.py index 406449a..360aae4 100644 --- a/yapftests/reformatter_basic_test.py +++ b/yapftests/reformatter_basic_test.py @@ -29,34 +29,36 @@ class BasicReformatterTest(yapf_test_helper.YAPFTest): style.SetGlobalStyle(style.CreateChromiumStyle()) def testSplittingAllArgs(self): - style.SetGlobalStyle(style.CreateStyleFromConfig('{split_all_comma_separated_values: true, column_limit: 40}')) - unformatted_code = textwrap.dedent("""\ + style.SetGlobalStyle( + style.CreateStyleFromConfig( + '{split_all_comma_separated_values: true, column_limit: 40}')) + unformatted_code = textwrap.dedent("""\ responseDict = {"timestamp": timestamp, "someValue": value, "whatever": 120} """) - expected_formatted_code = textwrap.dedent("""\ + expected_formatted_code = textwrap.dedent("""\ responseDict = { "timestamp": timestamp, "someValue": value, "whatever": 120 } """) - unformatted_code = textwrap.dedent("""\ + unformatted_code = textwrap.dedent("""\ def foo(long_arg, really_long_arg, really_really_long_arg, cant_keep_all_these_args): pass """) - expected_formatted_code = textwrap.dedent("""\ + expected_formatted_code = textwrap.dedent("""\ def foo(long_arg, really_long_arg, really_really_long_arg, cant_keep_all_these_args): pass """) - uwlines = yapf_test_helper.ParseAndUnwrap(unformatted_code) - self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines)) - unformatted_code = textwrap.dedent("""\ + uwlines = yapf_test_helper.ParseAndUnwrap(unformatted_code) + self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines)) + unformatted_code = textwrap.dedent("""\ foo_tuple = [long_arg, really_long_arg, really_really_long_arg, cant_keep_all_these_args] """) - expected_formatted_code = textwrap.dedent("""\ + expected_formatted_code = textwrap.dedent("""\ foo_tuple = [ long_arg, really_long_arg, @@ -64,16 +66,16 @@ class BasicReformatterTest(yapf_test_helper.YAPFTest): cant_keep_all_these_args ] """) - uwlines = yapf_test_helper.ParseAndUnwrap(unformatted_code) - self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines)) - unformatted_code = textwrap.dedent("""\ + uwlines = yapf_test_helper.ParseAndUnwrap(unformatted_code) + self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines)) + unformatted_code = textwrap.dedent("""\ foo_tuple = [short, arg] """) - expected_formatted_code = textwrap.dedent("""\ + expected_formatted_code = textwrap.dedent("""\ foo_tuple = [short, arg] """) - uwlines = yapf_test_helper.ParseAndUnwrap(unformatted_code) - self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines)) + uwlines = yapf_test_helper.ParseAndUnwrap(unformatted_code) + self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines)) def testSimpleFunctionsWithTrailingComments(self): unformatted_code = textwrap.dedent("""\ |