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

Unified Diff: appengine/swarming/handlers_endpoints_test.py

Issue 2249803003: Create Tasks.Tags endpoint and Cron job (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Patch Set: Docs Created 4 years, 4 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 | « appengine/swarming/handlers_endpoints.py ('k') | appengine/swarming/handlers_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/handlers_endpoints_test.py
diff --git a/appengine/swarming/handlers_endpoints_test.py b/appengine/swarming/handlers_endpoints_test.py
index c18189e474aaf504614f653eb16fb636d36666e2..2b58c11b98fc810ffe3b9aeb2450e17cf4b9fc33 100755
--- a/appengine/swarming/handlers_endpoints_test.py
+++ b/appengine/swarming/handlers_endpoints_test.py
@@ -858,6 +858,35 @@ class TasksApiTest(BaseTest):
expected = {u'now': str_now_120}
self.assertEqual(expected, result)
+ def test_tags_ok(self):
+ """Asserts that TasksTags is returned with the right data."""
+ self.set_as_privileged_user()
+ now = datetime.datetime(2009, 1, 2, 3, 4, 5, 6)
+ self.mock_now(now)
+ task_result.TagAggregation(
+ key=task_result.TagAggregation.KEY,
+ tags=[
+ task_result.TagValues(
+ tag='foo', values=['alpha', 'beta']),
+ task_result.TagValues(
+ tag='bar', values=['gamma', 'delta', 'epsilon']),
+ ],
+ ts=now).put()
+ expected = {
+ u'tasks_tags': [
+ {
+ u'key': 'foo',
+ u'value': [u'alpha', u'beta'],
+ },
+ {
+ u'key': 'bar',
+ u'value': [u'gamma', u'delta', u'epsilon'],
+ },
+ ],
+ u'ts': unicode(now.strftime(self.DATETIME_FORMAT)),
+ }
+ self.assertEqual(expected, self.call_api('tags', body={}).json)
+
def _gen_two_tasks(self):
# first request
now = datetime.datetime(2010, 1, 2, 3, 4, 5)
« no previous file with comments | « appengine/swarming/handlers_endpoints.py ('k') | appengine/swarming/handlers_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698