{"action":"created","comment":{"url":"https://api.github.com/repos/yola/sitewit/pulls/comments/27722388","id":27722388,"diff_hunk":"@@ -0,0 +1,66 @@\n+from mock import patch\n+\n+from base import CampaignTestCase\n+import sitewit.services\n+from sitewit.services import SitewitService\n+\n+\n+class TestGetCampaign(CampaignTestCase):\n+\n+    def setUp(self):\n+        service = SitewitService()\n+        self.result = service.get_campaign(\n+            self.account_token, self.campaign_id)\n+\n+    def test_campaign_is_returned(self):\n+        self.assertEqual(self.result, self.campaigns[1])\n+\n+\n+class TestGetCampaignNotFound(CampaignTestCase):\n+\n+    def test_error_404_is_raised(self):\n+        self.assertHTTPErrorIsRaised(\n+            SitewitService().get_campaign, (\n+                self.account_token, self.non_existent_campaign_id), 404)\n+\n+\n+class TestGetCampaignBadAccountToken(CampaignTestCase):\n+\n+    def test_error_401_is_raised(self):\n+        self.assertHTTPErrorIsRaised(\n+            SitewitService().get_campaign, (\n+                self.random_token, self.campaign_id),\n+            401, {u'Message': u'Malformed SubPartner Identifier'})\n+\n+\n+class TestListCampaigns(CampaignTestCase):\n+\n+    def setUp(self):\n+        service = SitewitService()\n+        self.result = service.list_campaigns(self.account_token)\n+\n+    def test_campaigns_list_is_returned(self):\n+        self.assertEqual(sorted(self.result), sorted(self.campaigns))\n+\n+\n+class TestListCampaignsBadAccountToken(CampaignTestCase):\n+\n+    def test_error_401_is_raised(self):\n+        self.assertHTTPErrorIsRaised(\n+            SitewitService().list_campaigns, (self.random_token,),\n+            401, {u'Message': u'Malformed SubPartner Identifier'})\n+\n+\n+class TestDeleteCampaign(CampaignTestCase):","path":"tests/campaigns/test_integration.py","position":54,"original_position":54,"commit_id":"41e2a2fd3ad740a84f745d26100e1d71e5a56fd7","original_commit_id":"41e2a2fd3ad740a84f745d26100e1d71e5a56fd7","user":{"login":"RayeN","id":712948,"avatar_url":"https://avatars.githubusercontent.com/u/712948?v=3","gravatar_id":"","url":"https://api.github.com/users/RayeN","html_url":"https://github.com/RayeN","followers_url":"https://api.github.com/users/RayeN/followers","following_url":"https://api.github.com/users/RayeN/following{/other_user}","gists_url":"https://api.github.com/users/RayeN/gists{/gist_id}","starred_url":"https://api.github.com/users/RayeN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RayeN/subscriptions","organizations_url":"https://api.github.com/users/RayeN/orgs","repos_url":"https://api.github.com/users/RayeN/repos","events_url":"https://api.github.com/users/RayeN/events{/privacy}","received_events_url":"https://api.github.com/users/RayeN/received_events","type":"User","site_admin":false},"body":"probably we shouldn't call this test integration, then...","created_at":"2015-04-03T09:33:48Z","updated_at":"2015-04-03T09:33:48Z","html_url":"https://github.com/yola/sitewit/pull/7#discussion_r27722388","pull_request_url":"https://api.github.com/repos/yola/sitewit/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/yola/sitewit/pulls/comments/27722388"},"html":{"href":"https://github.com/yola/sitewit/pull/7#discussion_r27722388"},"pull_request":{"href":"https://api.github.com/repos/yola/sitewit/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/yola/sitewit/pulls/7","id":32524365,"html_url":"https://github.com/yola/sitewit/pull/7","diff_url":"https://github.com/yola/sitewit/pull/7.diff","patch_url":"https://github.com/yola/sitewit/pull/7.patch","issue_url":"https://api.github.com/repos/yola/sitewit/issues/7","number":7,"state":"open","locked":false,"title":"Added Campaigns functionality.","user":{"login":"ekoval","id":954264,"avatar_url":"https://avatars.githubusercontent.com/u/954264?v=3","gravatar_id":"","url":"https://api.github.com/users/ekoval","html_url":"https://github.com/ekoval","followers_url":"https://api.github.com/users/ekoval/followers","following_url":"https://api.github.com/users/ekoval/following{/other_user}","gists_url":"https://api.github.com/users/ekoval/gists{/gist_id}","starred_url":"https://api.github.com/users/ekoval/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekoval/subscriptions","organizations_url":"https://api.github.com/users/ekoval/orgs","repos_url":"https://api.github.com/users/ekoval/repos","events_url":"https://api.github.com/users/ekoval/events{/privacy}","received_events_url":"https://api.github.com/users/ekoval/received_events","type":"User","site_admin":false},"body":"https://github.com/yola/production/issues/2116\r\nAlso, test code is re-structured a bit to be more scalable.\r\n\r\nNow tests have the following structure:\r\n```\r\ntests/base.py:SitewitTestCase\r\n        |______tests/accounts/base.py:AccountTestCase(SitewitTestCase)\r\n        |             |____tests for Accounts(AccountTestCase)\r\n        |\r\n        |______tests/campaigns/base.py:CampaignTestCase(SitewitTestCase)\r\n                      |____tests for Campaigns(CampaignTestCase)\r\n```","created_at":"2015-04-02T15:53:16Z","updated_at":"2015-04-03T09:33:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f9883475cf6fa3ce08b8c3b4d338c2244db3508","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yola/sitewit/pulls/7/commits","review_comments_url":"https://api.github.com/repos/yola/sitewit/pulls/7/comments","review_comment_url":"https://api.github.com/repos/yola/sitewit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yola/sitewit/issues/7/comments","statuses_url":"https://api.github.com/repos/yola/sitewit/statuses/41e2a2fd3ad740a84f745d26100e1d71e5a56fd7","head":{"label":"yola:add-campaign-functions","ref":"add-campaign-functions","sha":"41e2a2fd3ad740a84f745d26100e1d71e5a56fd7","user":{"login":"yola","id":861497,"avatar_url":"https://avatars.githubusercontent.com/u/861497?v=3","gravatar_id":"","url":"https://api.github.com/users/yola","html_url":"https://github.com/yola","followers_url":"https://api.github.com/users/yola/followers","following_url":"https://api.github.com/users/yola/following{/other_user}","gists_url":"https://api.github.com/users/yola/gists{/gist_id}","starred_url":"https://api.github.com/users/yola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yola/subscriptions","organizations_url":"https://api.github.com/users/yola/orgs","repos_url":"https://api.github.com/users/yola/repos","events_url":"https://api.github.com/users/yola/events{/privacy}","received_events_url":"https://api.github.com/users/yola/received_events","type":"Organization","site_admin":false},"repo":{"id":15058701,"name":"sitewit","full_name":"yola/sitewit","owner":{"login":"yola","id":861497,"avatar_url":"https://avatars.githubusercontent.com/u/861497?v=3","gravatar_id":"","url":"https://api.github.com/users/yola","html_url":"https://github.com/yola","followers_url":"https://api.github.com/users/yola/followers","following_url":"https://api.github.com/users/yola/following{/other_user}","gists_url":"https://api.github.com/users/yola/gists{/gist_id}","starred_url":"https://api.github.com/users/yola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yola/subscriptions","organizations_url":"https://api.github.com/users/yola/orgs","repos_url":"https://api.github.com/users/yola/repos","events_url":"https://api.github.com/users/yola/events{/privacy}","received_events_url":"https://api.github.com/users/yola/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yola/sitewit","description":"SiteWit Python client","fork":false,"url":"https://api.github.com/repos/yola/sitewit","forks_url":"https://api.github.com/repos/yola/sitewit/forks","keys_url":"https://api.github.com/repos/yola/sitewit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yola/sitewit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yola/sitewit/teams","hooks_url":"https://api.github.com/repos/yola/sitewit/hooks","issue_events_url":"https://api.github.com/repos/yola/sitewit/issues/events{/number}","events_url":"https://api.github.com/repos/yola/sitewit/events","assignees_url":"https://api.github.com/repos/yola/sitewit/assignees{/user}","branches_url":"https://api.github.com/repos/yola/sitewit/branches{/branch}","tags_url":"https://api.github.com/repos/yola/sitewit/tags","blobs_url":"https://api.github.com/repos/yola/sitewit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yola/sitewit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yola/sitewit/git/refs{/sha}","trees_url":"https://api.github.com/repos/yola/sitewit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yola/sitewit/statuses/{sha}","languages_url":"https://api.github.com/repos/yola/sitewit/languages","stargazers_url":"https://api.github.com/repos/yola/sitewit/stargazers","contributors_url":"https://api.github.com/repos/yola/sitewit/contributors","subscribers_url":"https://api.github.com/repos/yola/sitewit/subscribers","subscription_url":"https://api.github.com/repos/yola/sitewit/subscription","commits_url":"https://api.github.com/repos/yola/sitewit/commits{/sha}","git_commits_url":"https://api.github.com/repos/yola/sitewit/git/commits{/sha}","comments_url":"https://api.github.com/repos/yola/sitewit/comments{/number}","issue_comment_url":"https://api.github.com/repos/yola/sitewit/issues/comments{/number}","contents_url":"https://api.github.com/repos/yola/sitewit/contents/{+path}","compare_url":"https://api.github.com/repos/yola/sitewit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yola/sitewit/merges","archive_url":"https://api.github.com/repos/yola/sitewit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yola/sitewit/downloads","issues_url":"https://api.github.com/repos/yola/sitewit/issues{/number}","pulls_url":"https://api.github.com/repos/yola/sitewit/pulls{/number}","milestones_url":"https://api.github.com/repos/yola/sitewit/milestones{/number}","notifications_url":"https://api.github.com/repos/yola/sitewit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yola/sitewit/labels{/name}","releases_url":"https://api.github.com/repos/yola/sitewit/releases{/id}","created_at":"2013-12-09T20:50:03Z","updated_at":"2015-03-31T13:17:39Z","pushed_at":"2015-04-03T09:26:52Z","git_url":"git://github.com/yola/sitewit.git","ssh_url":"git@github.com:yola/sitewit.git","clone_url":"https://github.com/yola/sitewit.git","svn_url":"https://github.com/yola/sitewit","homepage":null,"size":288,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"yola:master","ref":"master","sha":"b370160fe7359265de5b1dba368a88b3dbcbcd1f","user":{"login":"yola","id":861497,"avatar_url":"https://avatars.githubusercontent.com/u/861497?v=3","gravatar_id":"","url":"https://api.github.com/users/yola","html_url":"https://github.com/yola","followers_url":"https://api.github.com/users/yola/followers","following_url":"https://api.github.com/users/yola/following{/other_user}","gists_url":"https://api.github.com/users/yola/gists{/gist_id}","starred_url":"https://api.github.com/users/yola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yola/subscriptions","organizations_url":"https://api.github.com/users/yola/orgs","repos_url":"https://api.github.com/users/yola/repos","events_url":"https://api.github.com/users/yola/events{/privacy}","received_events_url":"https://api.github.com/users/yola/received_events","type":"Organization","site_admin":false},"repo":{"id":15058701,"name":"sitewit","full_name":"yola/sitewit","owner":{"login":"yola","id":861497,"avatar_url":"https://avatars.githubusercontent.com/u/861497?v=3","gravatar_id":"","url":"https://api.github.com/users/yola","html_url":"https://github.com/yola","followers_url":"https://api.github.com/users/yola/followers","following_url":"https://api.github.com/users/yola/following{/other_user}","gists_url":"https://api.github.com/users/yola/gists{/gist_id}","starred_url":"https://api.github.com/users/yola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yola/subscriptions","organizations_url":"https://api.github.com/users/yola/orgs","repos_url":"https://api.github.com/users/yola/repos","events_url":"https://api.github.com/users/yola/events{/privacy}","received_events_url":"https://api.github.com/users/yola/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yola/sitewit","description":"SiteWit Python client","fork":false,"url":"https://api.github.com/repos/yola/sitewit","forks_url":"https://api.github.com/repos/yola/sitewit/forks","keys_url":"https://api.github.com/repos/yola/sitewit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yola/sitewit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yola/sitewit/teams","hooks_url":"https://api.github.com/repos/yola/sitewit/hooks","issue_events_url":"https://api.github.com/repos/yola/sitewit/issues/events{/number}","events_url":"https://api.github.com/repos/yola/sitewit/events","assignees_url":"https://api.github.com/repos/yola/sitewit/assignees{/user}","branches_url":"https://api.github.com/repos/yola/sitewit/branches{/branch}","tags_url":"https://api.github.com/repos/yola/sitewit/tags","blobs_url":"https://api.github.com/repos/yola/sitewit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yola/sitewit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yola/sitewit/git/refs{/sha}","trees_url":"https://api.github.com/repos/yola/sitewit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yola/sitewit/statuses/{sha}","languages_url":"https://api.github.com/repos/yola/sitewit/languages","stargazers_url":"https://api.github.com/repos/yola/sitewit/stargazers","contributors_url":"https://api.github.com/repos/yola/sitewit/contributors","subscribers_url":"https://api.github.com/repos/yola/sitewit/subscribers","subscription_url":"https://api.github.com/repos/yola/sitewit/subscription","commits_url":"https://api.github.com/repos/yola/sitewit/commits{/sha}","git_commits_url":"https://api.github.com/repos/yola/sitewit/git/commits{/sha}","comments_url":"https://api.github.com/repos/yola/sitewit/comments{/number}","issue_comment_url":"https://api.github.com/repos/yola/sitewit/issues/comments{/number}","contents_url":"https://api.github.com/repos/yola/sitewit/contents/{+path}","compare_url":"https://api.github.com/repos/yola/sitewit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yola/sitewit/merges","archive_url":"https://api.github.com/repos/yola/sitewit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yola/sitewit/downloads","issues_url":"https://api.github.com/repos/yola/sitewit/issues{/number}","pulls_url":"https://api.github.com/repos/yola/sitewit/pulls{/number}","milestones_url":"https://api.github.com/repos/yola/sitewit/milestones{/number}","notifications_url":"https://api.github.com/repos/yola/sitewit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yola/sitewit/labels{/name}","releases_url":"https://api.github.com/repos/yola/sitewit/releases{/id}","created_at":"2013-12-09T20:50:03Z","updated_at":"2015-03-31T13:17:39Z","pushed_at":"2015-04-03T09:26:52Z","git_url":"git://github.com/yola/sitewit.git","ssh_url":"git@github.com:yola/sitewit.git","clone_url":"https://github.com/yola/sitewit.git","svn_url":"https://github.com/yola/sitewit","homepage":null,"size":288,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yola/sitewit/pulls/7"},"html":{"href":"https://github.com/yola/sitewit/pull/7"},"issue":{"href":"https://api.github.com/repos/yola/sitewit/issues/7"},"comments":{"href":"https://api.github.com/repos/yola/sitewit/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/yola/sitewit/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/yola/sitewit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yola/sitewit/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/yola/sitewit/statuses/41e2a2fd3ad740a84f745d26100e1d71e5a56fd7"}}}}