{"action":"opened","number":40,"pull_request":{"url":"https://api.github.com/repos/CloudRift/Rift/pulls/40","id":40181881,"html_url":"https://github.com/CloudRift/Rift/pull/40","diff_url":"https://github.com/CloudRift/Rift/pull/40.diff","patch_url":"https://github.com/CloudRift/Rift/pull/40.patch","issue_url":"https://api.github.com/repos/CloudRift/Rift/issues/40","number":40,"state":"open","locked":false,"title":"API tests with webtest + mongomock (in progress)","user":{"login":"pglass","id":1077740,"avatar_url":"https://avatars.githubusercontent.com/u/1077740?v=3","gravatar_id":"","url":"https://api.github.com/users/pglass","html_url":"https://github.com/pglass","followers_url":"https://api.github.com/users/pglass/followers","following_url":"https://api.github.com/users/pglass/following{/other_user}","gists_url":"https://api.github.com/users/pglass/gists{/gist_id}","starred_url":"https://api.github.com/users/pglass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pglass/subscriptions","organizations_url":"https://api.github.com/users/pglass/orgs","repos_url":"https://api.github.com/users/pglass/repos","events_url":"https://api.github.com/users/pglass/events{/privacy}","received_events_url":"https://api.github.com/users/pglass/received_events","type":"User","site_admin":false},"body":"This uses [webtest](http://webtest.pythonpaste.org/en/latest/webtest.html) for simulating api requests without running gunicorn and [mongomock](https://github.com/vmalloc/mongomock) to mock out mongodb.\r\n\r\nThis does monkey patch `pymongo.MongoClient` for every test case, which may not be what we want. (I tried confining that monkey patch to just these new test modules, but that didn't work out. The patch needs to happen before the `rift.data.handler` module is imported anywhere, or the tests hang trying to connect to mongo, which isn't running. Maybe there's a nicer way to do that patching that I just don't know about, tough.)\r\n\r\nSome todos for this pull request:\r\n- [ ] Add some more positive test cases for other Job operations\r\n- [ ] Add test cases for Targets\r\n- [ ] Add negative test cases to check the jsonschema validation\r\n\r\nAnd I can probably refactor/reuse the request data I had for the validator test cases I wrote.\r\n","created_at":"2015-07-16T22:11:03Z","updated_at":"2015-07-16T22:11:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CloudRift/Rift/pulls/40/commits","review_comments_url":"https://api.github.com/repos/CloudRift/Rift/pulls/40/comments","review_comment_url":"https://api.github.com/repos/CloudRift/Rift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CloudRift/Rift/issues/40/comments","statuses_url":"https://api.github.com/repos/CloudRift/Rift/statuses/9bbdf18ddda7a88e9dcee633de65c0da390278fd","head":{"label":"pglass:api-tests","ref":"api-tests","sha":"9bbdf18ddda7a88e9dcee633de65c0da390278fd","user":{"login":"pglass","id":1077740,"avatar_url":"https://avatars.githubusercontent.com/u/1077740?v=3","gravatar_id":"","url":"https://api.github.com/users/pglass","html_url":"https://github.com/pglass","followers_url":"https://api.github.com/users/pglass/followers","following_url":"https://api.github.com/users/pglass/following{/other_user}","gists_url":"https://api.github.com/users/pglass/gists{/gist_id}","starred_url":"https://api.github.com/users/pglass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pglass/subscriptions","organizations_url":"https://api.github.com/users/pglass/orgs","repos_url":"https://api.github.com/users/pglass/repos","events_url":"https://api.github.com/users/pglass/events{/privacy}","received_events_url":"https://api.github.com/users/pglass/received_events","type":"User","site_admin":false},"repo":{"id":39038589,"name":"Rift","full_name":"pglass/Rift","owner":{"login":"pglass","id":1077740,"avatar_url":"https://avatars.githubusercontent.com/u/1077740?v=3","gravatar_id":"","url":"https://api.github.com/users/pglass","html_url":"https://github.com/pglass","followers_url":"https://api.github.com/users/pglass/followers","following_url":"https://api.github.com/users/pglass/following{/other_user}","gists_url":"https://api.github.com/users/pglass/gists{/gist_id}","starred_url":"https://api.github.com/users/pglass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pglass/subscriptions","organizations_url":"https://api.github.com/users/pglass/orgs","repos_url":"https://api.github.com/users/pglass/repos","events_url":"https://api.github.com/users/pglass/events{/privacy}","received_events_url":"https://api.github.com/users/pglass/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pglass/Rift","description":"","fork":true,"url":"https://api.github.com/repos/pglass/Rift","forks_url":"https://api.github.com/repos/pglass/Rift/forks","keys_url":"https://api.github.com/repos/pglass/Rift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pglass/Rift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pglass/Rift/teams","hooks_url":"https://api.github.com/repos/pglass/Rift/hooks","issue_events_url":"https://api.github.com/repos/pglass/Rift/issues/events{/number}","events_url":"https://api.github.com/repos/pglass/Rift/events","assignees_url":"https://api.github.com/repos/pglass/Rift/assignees{/user}","branches_url":"https://api.github.com/repos/pglass/Rift/branches{/branch}","tags_url":"https://api.github.com/repos/pglass/Rift/tags","blobs_url":"https://api.github.com/repos/pglass/Rift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pglass/Rift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pglass/Rift/git/refs{/sha}","trees_url":"https://api.github.com/repos/pglass/Rift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pglass/Rift/statuses/{sha}","languages_url":"https://api.github.com/repos/pglass/Rift/languages","stargazers_url":"https://api.github.com/repos/pglass/Rift/stargazers","contributors_url":"https://api.github.com/repos/pglass/Rift/contributors","subscribers_url":"https://api.github.com/repos/pglass/Rift/subscribers","subscription_url":"https://api.github.com/repos/pglass/Rift/subscription","commits_url":"https://api.github.com/repos/pglass/Rift/commits{/sha}","git_commits_url":"https://api.github.com/repos/pglass/Rift/git/commits{/sha}","comments_url":"https://api.github.com/repos/pglass/Rift/comments{/number}","issue_comment_url":"https://api.github.com/repos/pglass/Rift/issues/comments{/number}","contents_url":"https://api.github.com/repos/pglass/Rift/contents/{+path}","compare_url":"https://api.github.com/repos/pglass/Rift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pglass/Rift/merges","archive_url":"https://api.github.com/repos/pglass/Rift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pglass/Rift/downloads","issues_url":"https://api.github.com/repos/pglass/Rift/issues{/number}","pulls_url":"https://api.github.com/repos/pglass/Rift/pulls{/number}","milestones_url":"https://api.github.com/repos/pglass/Rift/milestones{/number}","notifications_url":"https://api.github.com/repos/pglass/Rift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pglass/Rift/labels{/name}","releases_url":"https://api.github.com/repos/pglass/Rift/releases{/id}","created_at":"2015-07-13T21:34:03Z","updated_at":"2015-07-13T21:34:03Z","pushed_at":"2015-07-16T21:55:49Z","git_url":"git://github.com/pglass/Rift.git","ssh_url":"git@github.com:pglass/Rift.git","clone_url":"https://github.com/pglass/Rift.git","svn_url":"https://github.com/pglass/Rift","homepage":null,"size":203,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"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":"CloudRift:master","ref":"master","sha":"f2ae5ddf909c7ce19d81a8b63350ef6a7354d7e8","user":{"login":"CloudRift","id":5210667,"avatar_url":"https://avatars.githubusercontent.com/u/5210667?v=3","gravatar_id":"","url":"https://api.github.com/users/CloudRift","html_url":"https://github.com/CloudRift","followers_url":"https://api.github.com/users/CloudRift/followers","following_url":"https://api.github.com/users/CloudRift/following{/other_user}","gists_url":"https://api.github.com/users/CloudRift/gists{/gist_id}","starred_url":"https://api.github.com/users/CloudRift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CloudRift/subscriptions","organizations_url":"https://api.github.com/users/CloudRift/orgs","repos_url":"https://api.github.com/users/CloudRift/repos","events_url":"https://api.github.com/users/CloudRift/events{/privacy}","received_events_url":"https://api.github.com/users/CloudRift/received_events","type":"Organization","site_admin":false},"repo":{"id":12229052,"name":"Rift","full_name":"CloudRift/Rift","owner":{"login":"CloudRift","id":5210667,"avatar_url":"https://avatars.githubusercontent.com/u/5210667?v=3","gravatar_id":"","url":"https://api.github.com/users/CloudRift","html_url":"https://github.com/CloudRift","followers_url":"https://api.github.com/users/CloudRift/followers","following_url":"https://api.github.com/users/CloudRift/following{/other_user}","gists_url":"https://api.github.com/users/CloudRift/gists{/gist_id}","starred_url":"https://api.github.com/users/CloudRift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CloudRift/subscriptions","organizations_url":"https://api.github.com/users/CloudRift/orgs","repos_url":"https://api.github.com/users/CloudRift/repos","events_url":"https://api.github.com/users/CloudRift/events{/privacy}","received_events_url":"https://api.github.com/users/CloudRift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CloudRift/Rift","description":"","fork":false,"url":"https://api.github.com/repos/CloudRift/Rift","forks_url":"https://api.github.com/repos/CloudRift/Rift/forks","keys_url":"https://api.github.com/repos/CloudRift/Rift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CloudRift/Rift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CloudRift/Rift/teams","hooks_url":"https://api.github.com/repos/CloudRift/Rift/hooks","issue_events_url":"https://api.github.com/repos/CloudRift/Rift/issues/events{/number}","events_url":"https://api.github.com/repos/CloudRift/Rift/events","assignees_url":"https://api.github.com/repos/CloudRift/Rift/assignees{/user}","branches_url":"https://api.github.com/repos/CloudRift/Rift/branches{/branch}","tags_url":"https://api.github.com/repos/CloudRift/Rift/tags","blobs_url":"https://api.github.com/repos/CloudRift/Rift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CloudRift/Rift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CloudRift/Rift/git/refs{/sha}","trees_url":"https://api.github.com/repos/CloudRift/Rift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CloudRift/Rift/statuses/{sha}","languages_url":"https://api.github.com/repos/CloudRift/Rift/languages","stargazers_url":"https://api.github.com/repos/CloudRift/Rift/stargazers","contributors_url":"https://api.github.com/repos/CloudRift/Rift/contributors","subscribers_url":"https://api.github.com/repos/CloudRift/Rift/subscribers","subscription_url":"https://api.github.com/repos/CloudRift/Rift/subscription","commits_url":"https://api.github.com/repos/CloudRift/Rift/commits{/sha}","git_commits_url":"https://api.github.com/repos/CloudRift/Rift/git/commits{/sha}","comments_url":"https://api.github.com/repos/CloudRift/Rift/comments{/number}","issue_comment_url":"https://api.github.com/repos/CloudRift/Rift/issues/comments{/number}","contents_url":"https://api.github.com/repos/CloudRift/Rift/contents/{+path}","compare_url":"https://api.github.com/repos/CloudRift/Rift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CloudRift/Rift/merges","archive_url":"https://api.github.com/repos/CloudRift/Rift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CloudRift/Rift/downloads","issues_url":"https://api.github.com/repos/CloudRift/Rift/issues{/number}","pulls_url":"https://api.github.com/repos/CloudRift/Rift/pulls{/number}","milestones_url":"https://api.github.com/repos/CloudRift/Rift/milestones{/number}","notifications_url":"https://api.github.com/repos/CloudRift/Rift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CloudRift/Rift/labels{/name}","releases_url":"https://api.github.com/repos/CloudRift/Rift/releases{/id}","created_at":"2013-08-19T22:25:31Z","updated_at":"2015-04-16T19:56:21Z","pushed_at":"2015-07-16T22:11:04Z","git_url":"git://github.com/CloudRift/Rift.git","ssh_url":"git@github.com:CloudRift/Rift.git","clone_url":"https://github.com/CloudRift/Rift.git","svn_url":"https://github.com/CloudRift/Rift","homepage":null,"size":996,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":10,"forks":5,"open_issues":10,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CloudRift/Rift/pulls/40"},"html":{"href":"https://github.com/CloudRift/Rift/pull/40"},"issue":{"href":"https://api.github.com/repos/CloudRift/Rift/issues/40"},"comments":{"href":"https://api.github.com/repos/CloudRift/Rift/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/CloudRift/Rift/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/CloudRift/Rift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CloudRift/Rift/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/CloudRift/Rift/statuses/9bbdf18ddda7a88e9dcee633de65c0da390278fd"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":73,"deletions":0,"changed_files":4}}