{"action":"created","comment":{"url":"https://api.github.com/repos/broadinstitute/aou-data-index/pulls/comments/130731205","pull_request_review_id":53639487,"id":130731205,"diff_hunk":"@@ -1,27 +1,126 @@\n from __future__ import absolute_import\n \n+import base64\n import doctest\n+import httpretty\n import unittest\n from data_index.controllers import datasets_controller\n from data_index.models.dataset import Dataset\n from data_index.models.list_datasets_response import ListDatasetsResponse\n-from data_index.test import BaseTestCase\n+from data_index.test import BaseTestCase, fake_elastic\n from six import BytesIO\n from flask import json\n+from parameterized import param, parameterized\n \n \n class TestDatasetsController(BaseTestCase):\n     \"\"\"Datasets tests.\"\"\"\n \n-    def test_list_datasets(self):\n-        query_string = [('pageSize', 56), ('pageToken', 'pageToken_example')]\n+    @parameterized.expand([\n+        ('page size 1', 1, 3),\n+        ('page size 2', 2, 2),\n+        ('page size 3', 3, 1),\n+        ('page size 4', 4, 1),\n+        ('page size large', 99999, 1),\n+        ('default', None, 1),\n+    ])\n+    def test_list_datasets(self, _, page_size, expected_pages):\n+        datasets = [\n+            Dataset(name='datasets/a'),\n+            Dataset(name='datasets/b'),\n+            Dataset(name='datasets/c'),\n+        ]\n+        dataset_docs = []\n+        for d in datasets:\n+            ds_id = d.name[len('datasets/'):]\n+            dataset_docs.append({\n+                '_id': ds_id,\n+                'source': {'id': ds_id},\n+            })\n+        expected = [d.to_dict() for d in datasets]\n+\n+        search_re = fake_elastic.search_re_fmt(BaseTestCase.INDEX_ADDR)\n+        def wrap_search_documents(request, uri, _):","path":"data_index/test/test_datasets_controller.py","position":46,"original_position":46,"commit_id":"fde994c830fe2cf4a7a453f1cc8b34b679be2f77","original_commit_id":"fde994c830fe2cf4a7a453f1cc8b34b679be2f77","user":{"login":"e4p","id":11793462,"avatar_url":"https://avatars0.githubusercontent.com/u/11793462?v=4","gravatar_id":"","url":"https://api.github.com/users/e4p","html_url":"https://github.com/e4p","followers_url":"https://api.github.com/users/e4p/followers","following_url":"https://api.github.com/users/e4p/following{/other_user}","gists_url":"https://api.github.com/users/e4p/gists{/gist_id}","starred_url":"https://api.github.com/users/e4p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e4p/subscriptions","organizations_url":"https://api.github.com/users/e4p/orgs","repos_url":"https://api.github.com/users/e4p/repos","events_url":"https://api.github.com/users/e4p/events{/privacy}","received_events_url":"https://api.github.com/users/e4p/received_events","type":"User","site_admin":false},"body":"Sounds good, this pull is ready for review by Broad.","created_at":"2017-08-01T21:17:47Z","updated_at":"2017-08-01T21:17:47Z","html_url":"https://github.com/broadinstitute/aou-data-index/pull/5#discussion_r130731205","pull_request_url":"https://api.github.com/repos/broadinstitute/aou-data-index/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/aou-data-index/pulls/comments/130731205"},"html":{"href":"https://github.com/broadinstitute/aou-data-index/pull/5#discussion_r130731205"},"pull_request":{"href":"https://api.github.com/repos/broadinstitute/aou-data-index/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/broadinstitute/aou-data-index/pulls/5","id":133353848,"html_url":"https://github.com/broadinstitute/aou-data-index/pull/5","diff_url":"https://github.com/broadinstitute/aou-data-index/pull/5.diff","patch_url":"https://github.com/broadinstitute/aou-data-index/pull/5.patch","issue_url":"https://api.github.com/repos/broadinstitute/aou-data-index/issues/5","number":5,"state":"open","locked":false,"title":"Implement ListDatasets","user":{"login":"calbach","id":822298,"avatar_url":"https://avatars0.githubusercontent.com/u/822298?v=4","gravatar_id":"","url":"https://api.github.com/users/calbach","html_url":"https://github.com/calbach","followers_url":"https://api.github.com/users/calbach/followers","following_url":"https://api.github.com/users/calbach/following{/other_user}","gists_url":"https://api.github.com/users/calbach/gists{/gist_id}","starred_url":"https://api.github.com/users/calbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calbach/subscriptions","organizations_url":"https://api.github.com/users/calbach/orgs","repos_url":"https://api.github.com/users/calbach/repos","events_url":"https://api.github.com/users/calbach/events{/privacy}","received_events_url":"https://api.github.com/users/calbach/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-07-31T22:47:07Z","updated_at":"2017-08-01T21:17:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75b8e22bc818666a64c15d19b820d989313757b0","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/broadinstitute/aou-data-index/pulls/5/commits","review_comments_url":"https://api.github.com/repos/broadinstitute/aou-data-index/pulls/5/comments","review_comment_url":"https://api.github.com/repos/broadinstitute/aou-data-index/pulls/comments{/number}","comments_url":"https://api.github.com/repos/broadinstitute/aou-data-index/issues/5/comments","statuses_url":"https://api.github.com/repos/broadinstitute/aou-data-index/statuses/fde994c830fe2cf4a7a453f1cc8b34b679be2f77","head":{"label":"calbach:list-datasets","ref":"list-datasets","sha":"fde994c830fe2cf4a7a453f1cc8b34b679be2f77","user":{"login":"calbach","id":822298,"avatar_url":"https://avatars0.githubusercontent.com/u/822298?v=4","gravatar_id":"","url":"https://api.github.com/users/calbach","html_url":"https://github.com/calbach","followers_url":"https://api.github.com/users/calbach/followers","following_url":"https://api.github.com/users/calbach/following{/other_user}","gists_url":"https://api.github.com/users/calbach/gists{/gist_id}","starred_url":"https://api.github.com/users/calbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calbach/subscriptions","organizations_url":"https://api.github.com/users/calbach/orgs","repos_url":"https://api.github.com/users/calbach/repos","events_url":"https://api.github.com/users/calbach/events{/privacy}","received_events_url":"https://api.github.com/users/calbach/received_events","type":"User","site_admin":false},"repo":{"id":94119946,"name":"aou-data-index","full_name":"calbach/aou-data-index","owner":{"login":"calbach","id":822298,"avatar_url":"https://avatars0.githubusercontent.com/u/822298?v=4","gravatar_id":"","url":"https://api.github.com/users/calbach","html_url":"https://github.com/calbach","followers_url":"https://api.github.com/users/calbach/followers","following_url":"https://api.github.com/users/calbach/following{/other_user}","gists_url":"https://api.github.com/users/calbach/gists{/gist_id}","starred_url":"https://api.github.com/users/calbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calbach/subscriptions","organizations_url":"https://api.github.com/users/calbach/orgs","repos_url":"https://api.github.com/users/calbach/repos","events_url":"https://api.github.com/users/calbach/events{/privacy}","received_events_url":"https://api.github.com/users/calbach/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/calbach/aou-data-index","description":null,"fork":true,"url":"https://api.github.com/repos/calbach/aou-data-index","forks_url":"https://api.github.com/repos/calbach/aou-data-index/forks","keys_url":"https://api.github.com/repos/calbach/aou-data-index/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calbach/aou-data-index/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calbach/aou-data-index/teams","hooks_url":"https://api.github.com/repos/calbach/aou-data-index/hooks","issue_events_url":"https://api.github.com/repos/calbach/aou-data-index/issues/events{/number}","events_url":"https://api.github.com/repos/calbach/aou-data-index/events","assignees_url":"https://api.github.com/repos/calbach/aou-data-index/assignees{/user}","branches_url":"https://api.github.com/repos/calbach/aou-data-index/branches{/branch}","tags_url":"https://api.github.com/repos/calbach/aou-data-index/tags","blobs_url":"https://api.github.com/repos/calbach/aou-data-index/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calbach/aou-data-index/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calbach/aou-data-index/git/refs{/sha}","trees_url":"https://api.github.com/repos/calbach/aou-data-index/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calbach/aou-data-index/statuses/{sha}","languages_url":"https://api.github.com/repos/calbach/aou-data-index/languages","stargazers_url":"https://api.github.com/repos/calbach/aou-data-index/stargazers","contributors_url":"https://api.github.com/repos/calbach/aou-data-index/contributors","subscribers_url":"https://api.github.com/repos/calbach/aou-data-index/subscribers","subscription_url":"https://api.github.com/repos/calbach/aou-data-index/subscription","commits_url":"https://api.github.com/repos/calbach/aou-data-index/commits{/sha}","git_commits_url":"https://api.github.com/repos/calbach/aou-data-index/git/commits{/sha}","comments_url":"https://api.github.com/repos/calbach/aou-data-index/comments{/number}","issue_comment_url":"https://api.github.com/repos/calbach/aou-data-index/issues/comments{/number}","contents_url":"https://api.github.com/repos/calbach/aou-data-index/contents/{+path}","compare_url":"https://api.github.com/repos/calbach/aou-data-index/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calbach/aou-data-index/merges","archive_url":"https://api.github.com/repos/calbach/aou-data-index/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calbach/aou-data-index/downloads","issues_url":"https://api.github.com/repos/calbach/aou-data-index/issues{/number}","pulls_url":"https://api.github.com/repos/calbach/aou-data-index/pulls{/number}","milestones_url":"https://api.github.com/repos/calbach/aou-data-index/milestones{/number}","notifications_url":"https://api.github.com/repos/calbach/aou-data-index/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calbach/aou-data-index/labels{/name}","releases_url":"https://api.github.com/repos/calbach/aou-data-index/releases{/id}","deployments_url":"https://api.github.com/repos/calbach/aou-data-index/deployments","created_at":"2017-06-12T16:58:11Z","updated_at":"2017-07-11T17:50:41Z","pushed_at":"2017-07-31T22:41:09Z","git_url":"git://github.com/calbach/aou-data-index.git","ssh_url":"git@github.com:calbach/aou-data-index.git","clone_url":"https://github.com/calbach/aou-data-index.git","svn_url":"https://github.com/calbach/aou-data-index","homepage":null,"size":55,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"broadinstitute:master","ref":"master","sha":"61801b9101b21e68a757ae63ebb1493775b420e9","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars0.githubusercontent.com/u/393552?v=4","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":92435055,"name":"aou-data-index","full_name":"broadinstitute/aou-data-index","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars0.githubusercontent.com/u/393552?v=4","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/aou-data-index","description":null,"fork":false,"url":"https://api.github.com/repos/broadinstitute/aou-data-index","forks_url":"https://api.github.com/repos/broadinstitute/aou-data-index/forks","keys_url":"https://api.github.com/repos/broadinstitute/aou-data-index/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/aou-data-index/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/aou-data-index/teams","hooks_url":"https://api.github.com/repos/broadinstitute/aou-data-index/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/aou-data-index/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/aou-data-index/events","assignees_url":"https://api.github.com/repos/broadinstitute/aou-data-index/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/aou-data-index/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/aou-data-index/tags","blobs_url":"https://api.github.com/repos/broadinstitute/aou-data-index/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/aou-data-index/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/aou-data-index/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/aou-data-index/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/aou-data-index/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/aou-data-index/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/aou-data-index/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/aou-data-index/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/aou-data-index/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/aou-data-index/subscription","commits_url":"https://api.github.com/repos/broadinstitute/aou-data-index/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/aou-data-index/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/aou-data-index/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/aou-data-index/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/aou-data-index/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/aou-data-index/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/aou-data-index/merges","archive_url":"https://api.github.com/repos/broadinstitute/aou-data-index/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/aou-data-index/downloads","issues_url":"https://api.github.com/repos/broadinstitute/aou-data-index/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/aou-data-index/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/aou-data-index/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/aou-data-index/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/aou-data-index/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/aou-data-index/releases{/id}","deployments_url":"https://api.github.com/repos/broadinstitute/aou-data-index/deployments","created_at":"2017-05-25T19:00:00Z","updated_at":"2017-07-11T13:07:23Z","pushed_at":"2017-07-31T22:47:08Z","git_url":"git://github.com/broadinstitute/aou-data-index.git","ssh_url":"git@github.com:broadinstitute/aou-data-index.git","clone_url":"https://github.com/broadinstitute/aou-data-index.git","svn_url":"https://github.com/broadinstitute/aou-data-index","homepage":null,"size":24,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/aou-data-index/pulls/5"},"html":{"href":"https://github.com/broadinstitute/aou-data-index/pull/5"},"issue":{"href":"https://api.github.com/repos/broadinstitute/aou-data-index/issues/5"},"comments":{"href":"https://api.github.com/repos/broadinstitute/aou-data-index/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/broadinstitute/aou-data-index/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/broadinstitute/aou-data-index/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/broadinstitute/aou-data-index/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/broadinstitute/aou-data-index/statuses/fde994c830fe2cf4a7a453f1cc8b34b679be2f77"}}}}
{"actor":{"display_login":"e4p"}}