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

Side by Side Diff: tests/rietveld_test.py

Issue 8508015: Create a new depot_tools_testing_lib to move utility modules there (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Renamed to testing_support Created 9 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 | Annotate | Revision Log
« no previous file with comments | « tests/presubmit_unittest.py ('k') | tests/scm_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Unit tests for rietveld.py.""" 6 """Unit tests for rietveld.py."""
7 7
8 import logging 8 import logging
9 import os 9 import os
10 import sys 10 import sys
11 import unittest 11 import unittest
12 12
13 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 13 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
14 14
15 from testing_support.patches_data import GIT, RAW
16
15 import patch 17 import patch
16 import rietveld 18 import rietveld
17 from tests.patches_data import GIT, RAW
18 19
19 20
20 def _api(files): 21 def _api(files):
21 """Mock a rietveld api request.""" 22 """Mock a rietveld api request."""
22 return rietveld.json.dumps({'files': files}) 23 return rietveld.json.dumps({'files': files})
23 24
24 25
25 def _file( 26 def _file(
26 status, is_binary=False, num_chunks=1, chunk_id=789, property_changes=''): 27 status, is_binary=False, num_chunks=1, chunk_id=789, property_changes=''):
27 """Mock a file in a rietveld api request.""" 28 """Mock a file in a rietveld api request."""
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 {'foo': 'prout'}, 343 {'foo': 'prout'},
343 ] 344 ]
344 for i in self.rietveld.search(base='base'): 345 for i in self.rietveld.search(base='base'):
345 self.assertEquals(expected.pop(0), i) 346 self.assertEquals(expected.pop(0), i)
346 self.assertEquals([], expected) 347 self.assertEquals([], expected)
347 348
348 349
349 if __name__ == '__main__': 350 if __name__ == '__main__':
350 logging.basicConfig(level=logging.ERROR) 351 logging.basicConfig(level=logging.ERROR)
351 unittest.main() 352 unittest.main()
OLDNEW
« no previous file with comments | « tests/presubmit_unittest.py ('k') | tests/scm_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698