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

Side by Side Diff: tests/rietveld_test.py

Issue 1482153002: rietveld.py: Change three_state_keys to emit "True" or "False" query params rather than 1/2. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Simplified query param generation Created 5 years 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
« no previous file with comments | « rietveld.py ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 ssl 10 import ssl
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 def test_search_all_empty(self): 332 def test_search_all_empty(self):
333 url = ( 333 url = (
334 '/search?format=json' 334 '/search?format=json'
335 '&base=base' 335 '&base=base'
336 '&created_after=2010-01-02' 336 '&created_after=2010-01-02'
337 '&created_before=2010-01-01' 337 '&created_before=2010-01-01'
338 '&modified_after=2010-02-02' 338 '&modified_after=2010-02-02'
339 '&modified_before=2010-02-01' 339 '&modified_before=2010-02-01'
340 '&owner=owner%40example.com' 340 '&owner=owner%40example.com'
341 '&reviewer=reviewer%40example.com' 341 '&reviewer=reviewer%40example.com'
342 '&closed=2' 342 '&closed=True'
343 '&commit=2' 343 '&commit=True'
344 '&private=2' 344 '&private=True'
345 '&keys_only=True' 345 '&keys_only=True'
346 '&with_messages=True' 346 '&with_messages=True'
347 '&limit=23') 347 '&limit=23')
348 self.requests = [ 348 self.requests = [
349 (url, '{}'), 349 (url, '{}'),
350 ] 350 ]
351 results = list(self.rietveld.search( 351 results = list(self.rietveld.search(
352 'owner@example.com', 352 'owner@example.com',
353 'reviewer@example.com', 353 'reviewer@example.com',
354 'base', 354 'base',
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 self.mock(time, 'sleep', self.MockSleep) 482 self.mock(time, 'sleep', self.MockSleep)
483 self.sleep_time = 0 483 self.sleep_time = 0
484 with self.assertRaises(ssl.SSLError): 484 with self.assertRaises(ssl.SSLError):
485 self.rietveld.post('/api/1234', [('key', 'data')]) 485 self.rietveld.post('/api/1234', [('key', 'data')])
486 self.assertNotEqual(self.sleep_time, 0) 486 self.assertNotEqual(self.sleep_time, 0)
487 487
488 if __name__ == '__main__': 488 if __name__ == '__main__':
489 logging.basicConfig(level=[ 489 logging.basicConfig(level=[
490 logging.ERROR, logging.INFO, logging.DEBUG][min(2, sys.argv.count('-v'))]) 490 logging.ERROR, logging.INFO, logging.DEBUG][min(2, sys.argv.count('-v'))])
491 unittest.main() 491 unittest.main()
OLDNEW
« no previous file with comments | « rietveld.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698