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

Unified Diff: tests/rietveld_test.py

Issue 7977030: Add my_reviews.py script for perf time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: another comment Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « rietveld.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/rietveld_test.py
diff --git a/tests/rietveld_test.py b/tests/rietveld_test.py
index ff43e459d91b1a42c441ac03bbf8cc97baaa7a26..3316df55eb6aaccae3b482ea400f3fc1212fad24 100755
--- a/tests/rietveld_test.py
+++ b/tests/rietveld_test.py
@@ -281,6 +281,70 @@ class RietveldTest(unittest.TestCase):
# TODO(maruel): Change with no diff, only svn property change:
# http://codereview.chromium.org/6462019/
+ def test_search_all_empty(self):
+ url = (
+ '/search?format=json'
+ '&base=base'
+ '&created_after=2010-01-02'
+ '&created_before=2010-01-01'
+ '&modified_after=2010-02-02'
+ '&modified_before=2010-02-01'
+ '&owner=owner%40example.com'
+ '&reviewer=reviewer%40example.com'
+ '&closed=2'
+ '&commit=2'
+ '&private=2'
+ '&keys_only=True'
+ '&with_messages=True'
+ '&limit=23')
+ self.requests = [
+ (url, '{}'),
+ ]
+ results = list(self.rietveld.search(
+ 'owner@example.com',
+ 'reviewer@example.com',
+ 'base',
+ True,
+ True,
+ True,
+ '2010-01-01',
+ '2010-01-02',
+ '2010-02-01',
+ '2010-02-02',
+ 23,
+ True,
+ True,
+ ))
+ self.assertEquals([], results)
+
+ def test_results_cursor(self):
+ # Verify cursor iteration is transparent.
+ self.requests = [
+ ('/search?format=json&base=base',
+ rietveld.json.dumps({
+ 'cursor': 'MY_CURSOR',
+ 'results': [{'foo': 'bar'}, {'foo': 'baz'}],
+ })),
+ ('/search?format=json&base=base&cursor=MY_CURSOR',
+ rietveld.json.dumps({
+ 'cursor': 'NEXT',
+ 'results': [{'foo': 'prout'}],
+ })),
+ ('/search?format=json&base=base&cursor=NEXT',
+ rietveld.json.dumps({
+ 'cursor': 'VOID',
+ 'results': [],
+ })),
+ ]
+ expected = [
+ {'foo': 'bar'},
+ {'foo': 'baz'},
+ {'foo': 'prout'},
+ ]
+ for i in self.rietveld.search(base='base'):
+ self.assertEquals(expected.pop(0), i)
+ self.assertEquals([], expected)
+
if __name__ == '__main__':
logging.basicConfig(level=logging.ERROR)
« 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