Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(521)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/formatter/main_unittest.py

Issue 2256793002: Make docstrings more consistent using format-webkitpy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make indentation of final quote based on parse tree (indentation prior to docstring node) rather th… Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import StringIO 5 import StringIO
6 import unittest 6 import unittest
7 7
8 from webkitpy.common.system.systemhost_mock import MockSystemHost 8 from webkitpy.common.system.systemhost_mock import MockSystemHost
9 from webkitpy.formatter.main import main 9 from webkitpy.formatter.main import main
10 10
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 self.assertMultiLineEqual(host.stdout.getvalue(), ''' 126 self.assertMultiLineEqual(host.stdout.getvalue(), '''
127 def f(): 127 def f():
128 """triple-quoted docstring 128 """triple-quoted docstring
129 with multiple lines 129 with multiple lines
130 """ 130 """
131 x = """ 131 x = """
132 this is a regular multi-line string, not a docstring 132 this is a regular multi-line string, not a docstring
133 """ 133 """
134 return x 134 return x
135 ''') 135 ''')
136
137 def test_format_docstrings_indentation(self):
138 host = MockSystemHost()
139 host.stdin = StringIO.StringIO('''
140 def f():
141 """This is a docstring
142 With extra indentation on this line.
143
144 """
145 ''')
146 main(host, ['-'])
147 self.assertMultiLineEqual(host.stdout.getvalue(), '''
148 def f():
149 """This is a docstring
150 With extra indentation on this line.
151 """
152 ''')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698