{"action":"closed","number":76,"pull_request":{"url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/pulls/76","id":40754964,"html_url":"https://github.com/wmde/Lizenzverweisgenerator/pull/76","diff_url":"https://github.com/wmde/Lizenzverweisgenerator/pull/76.diff","patch_url":"https://github.com/wmde/Lizenzverweisgenerator/pull/76.patch","issue_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/issues/76","number":76,"state":"closed","locked":false,"title":"Use Commons API handler mock in tests","user":{"login":"wmde-manicki","id":12729452,"avatar_url":"https://avatars.githubusercontent.com/u/12729452?v=3","gravatar_id":"","url":"https://api.github.com/users/wmde-manicki","html_url":"https://github.com/wmde-manicki","followers_url":"https://api.github.com/users/wmde-manicki/followers","following_url":"https://api.github.com/users/wmde-manicki/following{/other_user}","gists_url":"https://api.github.com/users/wmde-manicki/gists{/gist_id}","starred_url":"https://api.github.com/users/wmde-manicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmde-manicki/subscriptions","organizations_url":"https://api.github.com/users/wmde-manicki/orgs","repos_url":"https://api.github.com/users/wmde-manicki/repos","events_url":"https://api.github.com/users/wmde-manicki/events{/privacy}","received_events_url":"https://api.github.com/users/wmde-manicki/received_events","type":"User","site_admin":false},"body":"Some tests are covering methods that are making actual Commons API (or API of some particular Wikipedia). This approach seems to have several drawbacks:\r\n - Several \"test assets\" are used as test cases and are compared with data returned by API. When the page used as a test case is changed on Commons, the change may, depending on the change itself, cause tests to fail. These failures are in most cases not being caused by any flaws in the method under test but are due to irrelevant differences between the expected form of a page and a \"live\" version of it, e.g. adding some extra text to author field, changing the URL of author's website.\r\n - Every time tests are run, multiple calls to API are being done. Among others things, it takes time.\r\n - Tests will fail if API is, for any reason, not available.\r\n - As noted in https://phabricator.wikimedia.org/T107023 tests using API calls are failing when not run in browser (e.g. on Travis). It seems to be, at least partially, related to reaching the timeout while waiting for API responses (there are some more possible issues under investigation).\r\n\r\nWhat I am proposing here is to provide local copy of API responses for calls used in tests as of the moment of filing this pull request. These could be used as consistent tests cases. Tests are no longer dependent on what is being returned by API at the very moment of running the tests. Tests for processing API responses can be then also run from command line, on Travis, etc, without a need to do at least time-consuming API calls. Tests using \"real\" API are still there and could be run in browser whenever wanted.","created_at":"2015-07-24T08:57:23Z","updated_at":"2015-07-27T11:34:05Z","closed_at":"2015-07-27T11:34:05Z","merged_at":"2015-07-27T11:34:05Z","merge_commit_sha":"0a47f62e013e0813854188c9832a8fbf77c9e9c9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/pulls/76/commits","review_comments_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/pulls/76/comments","review_comment_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/issues/76/comments","statuses_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/statuses/91950045840164a5501ea09046b9ccc7c015219a","head":{"label":"wmde:mock-api-in-tests","ref":"mock-api-in-tests","sha":"91950045840164a5501ea09046b9ccc7c015219a","user":{"login":"wmde","id":664724,"avatar_url":"https://avatars.githubusercontent.com/u/664724?v=3","gravatar_id":"","url":"https://api.github.com/users/wmde","html_url":"https://github.com/wmde","followers_url":"https://api.github.com/users/wmde/followers","following_url":"https://api.github.com/users/wmde/following{/other_user}","gists_url":"https://api.github.com/users/wmde/gists{/gist_id}","starred_url":"https://api.github.com/users/wmde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmde/subscriptions","organizations_url":"https://api.github.com/users/wmde/orgs","repos_url":"https://api.github.com/users/wmde/repos","events_url":"https://api.github.com/users/wmde/events{/privacy}","received_events_url":"https://api.github.com/users/wmde/received_events","type":"Organization","site_admin":false},"repo":{"id":13495756,"name":"Lizenzverweisgenerator","full_name":"wmde/Lizenzverweisgenerator","owner":{"login":"wmde","id":664724,"avatar_url":"https://avatars.githubusercontent.com/u/664724?v=3","gravatar_id":"","url":"https://api.github.com/users/wmde","html_url":"https://github.com/wmde","followers_url":"https://api.github.com/users/wmde/followers","following_url":"https://api.github.com/users/wmde/following{/other_user}","gists_url":"https://api.github.com/users/wmde/gists{/gist_id}","starred_url":"https://api.github.com/users/wmde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmde/subscriptions","organizations_url":"https://api.github.com/users/wmde/orgs","repos_url":"https://api.github.com/users/wmde/repos","events_url":"https://api.github.com/users/wmde/events{/privacy}","received_events_url":"https://api.github.com/users/wmde/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wmde/Lizenzverweisgenerator","description":"An application that helps generating a legally correct attribution with images from Wikipedia, Wikimedia Commons or any other online resource.","fork":false,"url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator","forks_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/forks","keys_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/teams","hooks_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/hooks","issue_events_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/issues/events{/number}","events_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/events","assignees_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/assignees{/user}","branches_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/branches{/branch}","tags_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/tags","blobs_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/git/refs{/sha}","trees_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/statuses/{sha}","languages_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/languages","stargazers_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/stargazers","contributors_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/contributors","subscribers_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/subscribers","subscription_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/subscription","commits_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/commits{/sha}","git_commits_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/git/commits{/sha}","comments_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/comments{/number}","issue_comment_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/issues/comments{/number}","contents_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/contents/{+path}","compare_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/merges","archive_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/downloads","issues_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/issues{/number}","pulls_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/pulls{/number}","milestones_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/milestones{/number}","notifications_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/labels{/name}","releases_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/releases{/id}","created_at":"2013-10-11T10:06:00Z","updated_at":"2015-07-27T10:26:03Z","pushed_at":"2015-07-27T11:34:05Z","git_url":"git://github.com/wmde/Lizenzverweisgenerator.git","ssh_url":"git@github.com:wmde/Lizenzverweisgenerator.git","clone_url":"https://github.com/wmde/Lizenzverweisgenerator.git","svn_url":"https://github.com/wmde/Lizenzverweisgenerator","homepage":"http://tools.wmflabs.org/file-reuse/","size":3146,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"wmde:master","ref":"master","sha":"ea36a8d75ad53b9a4fee23cd9ed1b7a5b75f5164","user":{"login":"wmde","id":664724,"avatar_url":"https://avatars.githubusercontent.com/u/664724?v=3","gravatar_id":"","url":"https://api.github.com/users/wmde","html_url":"https://github.com/wmde","followers_url":"https://api.github.com/users/wmde/followers","following_url":"https://api.github.com/users/wmde/following{/other_user}","gists_url":"https://api.github.com/users/wmde/gists{/gist_id}","starred_url":"https://api.github.com/users/wmde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmde/subscriptions","organizations_url":"https://api.github.com/users/wmde/orgs","repos_url":"https://api.github.com/users/wmde/repos","events_url":"https://api.github.com/users/wmde/events{/privacy}","received_events_url":"https://api.github.com/users/wmde/received_events","type":"Organization","site_admin":false},"repo":{"id":13495756,"name":"Lizenzverweisgenerator","full_name":"wmde/Lizenzverweisgenerator","owner":{"login":"wmde","id":664724,"avatar_url":"https://avatars.githubusercontent.com/u/664724?v=3","gravatar_id":"","url":"https://api.github.com/users/wmde","html_url":"https://github.com/wmde","followers_url":"https://api.github.com/users/wmde/followers","following_url":"https://api.github.com/users/wmde/following{/other_user}","gists_url":"https://api.github.com/users/wmde/gists{/gist_id}","starred_url":"https://api.github.com/users/wmde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmde/subscriptions","organizations_url":"https://api.github.com/users/wmde/orgs","repos_url":"https://api.github.com/users/wmde/repos","events_url":"https://api.github.com/users/wmde/events{/privacy}","received_events_url":"https://api.github.com/users/wmde/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wmde/Lizenzverweisgenerator","description":"An application that helps generating a legally correct attribution with images from Wikipedia, Wikimedia Commons or any other online resource.","fork":false,"url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator","forks_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/forks","keys_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/teams","hooks_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/hooks","issue_events_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/issues/events{/number}","events_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/events","assignees_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/assignees{/user}","branches_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/branches{/branch}","tags_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/tags","blobs_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/git/refs{/sha}","trees_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/statuses/{sha}","languages_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/languages","stargazers_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/stargazers","contributors_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/contributors","subscribers_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/subscribers","subscription_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/subscription","commits_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/commits{/sha}","git_commits_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/git/commits{/sha}","comments_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/comments{/number}","issue_comment_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/issues/comments{/number}","contents_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/contents/{+path}","compare_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/merges","archive_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/downloads","issues_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/issues{/number}","pulls_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/pulls{/number}","milestones_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/milestones{/number}","notifications_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/labels{/name}","releases_url":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/releases{/id}","created_at":"2013-10-11T10:06:00Z","updated_at":"2015-07-27T10:26:03Z","pushed_at":"2015-07-27T11:34:05Z","git_url":"git://github.com/wmde/Lizenzverweisgenerator.git","ssh_url":"git@github.com:wmde/Lizenzverweisgenerator.git","clone_url":"https://github.com/wmde/Lizenzverweisgenerator.git","svn_url":"https://github.com/wmde/Lizenzverweisgenerator","homepage":"http://tools.wmflabs.org/file-reuse/","size":3146,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/pulls/76"},"html":{"href":"https://github.com/wmde/Lizenzverweisgenerator/pull/76"},"issue":{"href":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/issues/76"},"comments":{"href":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/wmde/Lizenzverweisgenerator/statuses/91950045840164a5501ea09046b9ccc7c015219a"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"WMDE-Fisch","id":8479008,"avatar_url":"https://avatars.githubusercontent.com/u/8479008?v=3","gravatar_id":"","url":"https://api.github.com/users/WMDE-Fisch","html_url":"https://github.com/WMDE-Fisch","followers_url":"https://api.github.com/users/WMDE-Fisch/followers","following_url":"https://api.github.com/users/WMDE-Fisch/following{/other_user}","gists_url":"https://api.github.com/users/WMDE-Fisch/gists{/gist_id}","starred_url":"https://api.github.com/users/WMDE-Fisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WMDE-Fisch/subscriptions","organizations_url":"https://api.github.com/users/WMDE-Fisch/orgs","repos_url":"https://api.github.com/users/WMDE-Fisch/repos","events_url":"https://api.github.com/users/WMDE-Fisch/events{/privacy}","received_events_url":"https://api.github.com/users/WMDE-Fisch/received_events","type":"User","site_admin":false},"comments":3,"review_comments":0,"commits":19,"additions":3569,"deletions":66,"changed_files":91}}