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

Side by Side Diff: appengine/findit/util_scripts/git_checkout/test/local_git_parsers_test.py

Issue 2432113002: [Findit] Add local_git_repository (Closed)
Patch Set: Rebase. Created 4 years, 1 month 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 from datetime import datetime 5 from datetime import datetime
6 from datetime import timedelta 6 from datetime import timedelta
7 import os 7 import os
8 import sys 8 import sys
9 import textwrap 9 import textwrap
10 import unittest 10 import unittest
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 'rev3', None, 223 'rev3', None,
224 'Message 3', [change_log.FileChangeInfo( 224 'Message 3', [change_log.FileChangeInfo(
225 'rename', 'b/c.py', 'b/cc.py')], 225 'rename', 'b/c.py', 'b/cc.py')],
226 'http://repo/+/rev3', None, None), 226 'http://repo/+/rev3', None, None),
227 ] 227 ]
228 228
229 changelogs = local_git_parsers.GitChangeLogsParser()(output, 'http://repo') 229 changelogs = local_git_parsers.GitChangeLogsParser()(output, 'http://repo')
230 for changelog, expected_changelog in zip(changelogs, expected_changelogs): 230 for changelog, expected_changelog in zip(changelogs, expected_changelogs):
231 self.assertEqual(changelog.ToDict(), expected_changelog.ToDict()) 231 self.assertEqual(changelog.ToDict(), expected_changelog.ToDict())
232 232
233
234 def testGitChangeLogsParserParseEmptyOutput(self): 233 def testGitChangeLogsParserParseEmptyOutput(self):
235 self.assertIsNone(local_git_parsers.GitChangeLogsParser()(None, 'repo')) 234 self.assertIsNone(local_git_parsers.GitChangeLogsParser()(None, 'repo'))
236 235
237 def testGitChangeLogsParserWithEmptyChangelog(self): 236 def testGitChangeLogsParserWithEmptyChangelog(self):
238 output = '**Changelog start**\nblablabla' 237 output = '**Changelog start**\nblablabla'
239 self.assertEqual(local_git_parsers.GitChangeLogsParser()(output, 238 self.assertEqual(local_git_parsers.GitChangeLogsParser()(output,
240 'http://repo'), []) 239 'http://repo'), [])
241 240
242 def testGitDiffParser(self): 241 def testGitDiffParser(self):
243 self.assertEqual('output', local_git_parsers.GitDiffParser()('output')) 242 self.assertEqual('output', local_git_parsers.GitDiffParser()('output'))
244 243
245 244
246 if __name__ == '__main__': 245 if __name__ == '__main__':
247 unittest.main() 246 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698