{"action":"created","comment":{"url":"https://api.github.com/repos/swcarpentry/amy/pulls/comments/34913183","id":34913183,"diff_hunk":"@@ -321,3 +328,104 @@ def test_upload_existing_user_existing_task(self):\n         self.assertEqual(tasks_pre, tasks_post)\n         self.assertEqual(users_pre, users_post)\n         self.assertEqual(rv.status_code, 200)\n+\n+\n+class TestEventURLNormalization(TestCase):\n+    def setUp(self):\n+        self.test_cases = [\n+            'http://username.github.io/2015-07-13-City/',\n+            'http://username.github.io/2015-07-13-City',\n+            'http://username.github.io/2015-07-13-City/index.html',\n+            'https://github.com/username/2015-07-13-City/',\n+            'https://github.com/username/2015-07-13-City',\n+            ('https://github.com/username/2015-07-13-City/blob/'\n+             'gh-pages/index.html'),\n+        ]\n+\n+        self.output = ('https://raw.githubusercontent.com/username/'\n+                       '2015-07-13-City/gh-pages/index.html')\n+\n+    def test_normalization(self):\n+        for url in self.test_cases:\n+            assert normalize_event_index_url(url)[0] == self.output\n+\n+\n+class TestParsingEventHeaders(TestCase):\n+\n+    # Response.status_code apparently doesn't exist by default\n+    @patch.object(requests.models.Response, 'status_code', 404, create=True)\n+    def test_wrong_url(self):\n+        with self.assertRaises(requests.exceptions.HTTPError):\n+            url = 'http://test.github.io/2015-07-13-test/'\n+            parse_tags_from_event_index(url)\n+\n+    @patch.object(requests, 'get')\n+    def test_parsing_event_index(self, mock_get):\n+        mock_get.return_value.status_code = 200\n+        mock_get.return_value.text = \"\"\"---\n+layout: workshop\n+root: .\n+venue: Euphoric State University\n+address: Highway to Heaven 42, Academipolis\n+country: USA\n+language: us\n+latlng: 36.998977, -109.045173\n+humandate: Jul 13-14, 2015\n+humantime: 9:00 - 17:00\n+startdate: 2015-07-13\n+enddate: 2015-07-14\n+instructor: [\"Hermione Granger\", \"Harry Potter\", \"Ron Weasley\",]\n+helper: [\"Peter Parker\", \"Tony Stark\", \"Natasha Romanova\",]","path":"workshops/test/test_util.py","position":77,"original_position":77,"commit_id":"885539ab77657cf2c0f3e3cc65686ec5f48cff6b","original_commit_id":"885539ab77657cf2c0f3e3cc65686ec5f48cff6b","user":{"login":"r-gaia-cs","id":1506457,"avatar_url":"https://avatars.githubusercontent.com/u/1506457?v=3","gravatar_id":"","url":"https://api.github.com/users/r-gaia-cs","html_url":"https://github.com/r-gaia-cs","followers_url":"https://api.github.com/users/r-gaia-cs/followers","following_url":"https://api.github.com/users/r-gaia-cs/following{/other_user}","gists_url":"https://api.github.com/users/r-gaia-cs/gists{/gist_id}","starred_url":"https://api.github.com/users/r-gaia-cs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-gaia-cs/subscriptions","organizations_url":"https://api.github.com/users/r-gaia-cs/orgs","repos_url":"https://api.github.com/users/r-gaia-cs/repos","events_url":"https://api.github.com/users/r-gaia-cs/events{/privacy}","received_events_url":"https://api.github.com/users/r-gaia-cs/received_events","type":"User","site_admin":false},"body":"LOL","created_at":"2015-07-17T17:45:04Z","updated_at":"2015-07-17T17:45:04Z","html_url":"https://github.com/swcarpentry/amy/pull/426#discussion_r34913183","pull_request_url":"https://api.github.com/repos/swcarpentry/amy/pulls/426","_links":{"self":{"href":"https://api.github.com/repos/swcarpentry/amy/pulls/comments/34913183"},"html":{"href":"https://github.com/swcarpentry/amy/pull/426#discussion_r34913183"},"pull_request":{"href":"https://api.github.com/repos/swcarpentry/amy/pulls/426"}}},"pull_request":{"url":"https://api.github.com/repos/swcarpentry/amy/pulls/426","id":39826626,"html_url":"https://github.com/swcarpentry/amy/pull/426","diff_url":"https://github.com/swcarpentry/amy/pull/426.diff","patch_url":"https://github.com/swcarpentry/amy/pull/426.patch","issue_url":"https://api.github.com/repos/swcarpentry/amy/issues/426","number":426,"state":"open","locked":false,"title":"Import event data from URL","user":{"login":"pbanaszkiewicz","id":72821,"avatar_url":"https://avatars.githubusercontent.com/u/72821?v=3","gravatar_id":"","url":"https://api.github.com/users/pbanaszkiewicz","html_url":"https://github.com/pbanaszkiewicz","followers_url":"https://api.github.com/users/pbanaszkiewicz/followers","following_url":"https://api.github.com/users/pbanaszkiewicz/following{/other_user}","gists_url":"https://api.github.com/users/pbanaszkiewicz/gists{/gist_id}","starred_url":"https://api.github.com/users/pbanaszkiewicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbanaszkiewicz/subscriptions","organizations_url":"https://api.github.com/users/pbanaszkiewicz/orgs","repos_url":"https://api.github.com/users/pbanaszkiewicz/repos","events_url":"https://api.github.com/users/pbanaszkiewicz/events{/privacy}","received_events_url":"https://api.github.com/users/pbanaszkiewicz/received_events","type":"User","site_admin":false},"body":"More details in commit messages.","created_at":"2015-07-13T15:52:21Z","updated_at":"2015-07-17T17:45:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4071824d1a2be11978ec46bc402c72d56815308","assignee":{"login":"r-gaia-cs","id":1506457,"avatar_url":"https://avatars.githubusercontent.com/u/1506457?v=3","gravatar_id":"","url":"https://api.github.com/users/r-gaia-cs","html_url":"https://github.com/r-gaia-cs","followers_url":"https://api.github.com/users/r-gaia-cs/followers","following_url":"https://api.github.com/users/r-gaia-cs/following{/other_user}","gists_url":"https://api.github.com/users/r-gaia-cs/gists{/gist_id}","starred_url":"https://api.github.com/users/r-gaia-cs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-gaia-cs/subscriptions","organizations_url":"https://api.github.com/users/r-gaia-cs/orgs","repos_url":"https://api.github.com/users/r-gaia-cs/repos","events_url":"https://api.github.com/users/r-gaia-cs/events{/privacy}","received_events_url":"https://api.github.com/users/r-gaia-cs/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/swcarpentry/amy/milestones/5","html_url":"https://github.com/swcarpentry/amy/milestones/v0.6","labels_url":"https://api.github.com/repos/swcarpentry/amy/milestones/5/labels","id":1173462,"number":5,"title":"v0.6","description":"Another sprint.","creator":{"login":"pbanaszkiewicz","id":72821,"avatar_url":"https://avatars.githubusercontent.com/u/72821?v=3","gravatar_id":"","url":"https://api.github.com/users/pbanaszkiewicz","html_url":"https://github.com/pbanaszkiewicz","followers_url":"https://api.github.com/users/pbanaszkiewicz/followers","following_url":"https://api.github.com/users/pbanaszkiewicz/following{/other_user}","gists_url":"https://api.github.com/users/pbanaszkiewicz/gists{/gist_id}","starred_url":"https://api.github.com/users/pbanaszkiewicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbanaszkiewicz/subscriptions","organizations_url":"https://api.github.com/users/pbanaszkiewicz/orgs","repos_url":"https://api.github.com/users/pbanaszkiewicz/repos","events_url":"https://api.github.com/users/pbanaszkiewicz/events{/privacy}","received_events_url":"https://api.github.com/users/pbanaszkiewicz/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":27,"state":"open","created_at":"2015-06-20T13:23:32Z","updated_at":"2015-07-17T17:06:08Z","due_on":"2015-07-16T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/swcarpentry/amy/pulls/426/commits","review_comments_url":"https://api.github.com/repos/swcarpentry/amy/pulls/426/comments","review_comment_url":"https://api.github.com/repos/swcarpentry/amy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/swcarpentry/amy/issues/426/comments","statuses_url":"https://api.github.com/repos/swcarpentry/amy/statuses/885539ab77657cf2c0f3e3cc65686ec5f48cff6b","head":{"label":"pbanaszkiewicz:import-event-from-url","ref":"import-event-from-url","sha":"885539ab77657cf2c0f3e3cc65686ec5f48cff6b","user":{"login":"pbanaszkiewicz","id":72821,"avatar_url":"https://avatars.githubusercontent.com/u/72821?v=3","gravatar_id":"","url":"https://api.github.com/users/pbanaszkiewicz","html_url":"https://github.com/pbanaszkiewicz","followers_url":"https://api.github.com/users/pbanaszkiewicz/followers","following_url":"https://api.github.com/users/pbanaszkiewicz/following{/other_user}","gists_url":"https://api.github.com/users/pbanaszkiewicz/gists{/gist_id}","starred_url":"https://api.github.com/users/pbanaszkiewicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbanaszkiewicz/subscriptions","organizations_url":"https://api.github.com/users/pbanaszkiewicz/orgs","repos_url":"https://api.github.com/users/pbanaszkiewicz/repos","events_url":"https://api.github.com/users/pbanaszkiewicz/events{/privacy}","received_events_url":"https://api.github.com/users/pbanaszkiewicz/received_events","type":"User","site_admin":false},"repo":{"id":28005098,"name":"amy","full_name":"pbanaszkiewicz/amy","owner":{"login":"pbanaszkiewicz","id":72821,"avatar_url":"https://avatars.githubusercontent.com/u/72821?v=3","gravatar_id":"","url":"https://api.github.com/users/pbanaszkiewicz","html_url":"https://github.com/pbanaszkiewicz","followers_url":"https://api.github.com/users/pbanaszkiewicz/followers","following_url":"https://api.github.com/users/pbanaszkiewicz/following{/other_user}","gists_url":"https://api.github.com/users/pbanaszkiewicz/gists{/gist_id}","starred_url":"https://api.github.com/users/pbanaszkiewicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbanaszkiewicz/subscriptions","organizations_url":"https://api.github.com/users/pbanaszkiewicz/orgs","repos_url":"https://api.github.com/users/pbanaszkiewicz/repos","events_url":"https://api.github.com/users/pbanaszkiewicz/events{/privacy}","received_events_url":"https://api.github.com/users/pbanaszkiewicz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pbanaszkiewicz/amy","description":"A web-based workshop administration application built using Django.","fork":true,"url":"https://api.github.com/repos/pbanaszkiewicz/amy","forks_url":"https://api.github.com/repos/pbanaszkiewicz/amy/forks","keys_url":"https://api.github.com/repos/pbanaszkiewicz/amy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pbanaszkiewicz/amy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pbanaszkiewicz/amy/teams","hooks_url":"https://api.github.com/repos/pbanaszkiewicz/amy/hooks","issue_events_url":"https://api.github.com/repos/pbanaszkiewicz/amy/issues/events{/number}","events_url":"https://api.github.com/repos/pbanaszkiewicz/amy/events","assignees_url":"https://api.github.com/repos/pbanaszkiewicz/amy/assignees{/user}","branches_url":"https://api.github.com/repos/pbanaszkiewicz/amy/branches{/branch}","tags_url":"https://api.github.com/repos/pbanaszkiewicz/amy/tags","blobs_url":"https://api.github.com/repos/pbanaszkiewicz/amy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pbanaszkiewicz/amy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pbanaszkiewicz/amy/git/refs{/sha}","trees_url":"https://api.github.com/repos/pbanaszkiewicz/amy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pbanaszkiewicz/amy/statuses/{sha}","languages_url":"https://api.github.com/repos/pbanaszkiewicz/amy/languages","stargazers_url":"https://api.github.com/repos/pbanaszkiewicz/amy/stargazers","contributors_url":"https://api.github.com/repos/pbanaszkiewicz/amy/contributors","subscribers_url":"https://api.github.com/repos/pbanaszkiewicz/amy/subscribers","subscription_url":"https://api.github.com/repos/pbanaszkiewicz/amy/subscription","commits_url":"https://api.github.com/repos/pbanaszkiewicz/amy/commits{/sha}","git_commits_url":"https://api.github.com/repos/pbanaszkiewicz/amy/git/commits{/sha}","comments_url":"https://api.github.com/repos/pbanaszkiewicz/amy/comments{/number}","issue_comment_url":"https://api.github.com/repos/pbanaszkiewicz/amy/issues/comments{/number}","contents_url":"https://api.github.com/repos/pbanaszkiewicz/amy/contents/{+path}","compare_url":"https://api.github.com/repos/pbanaszkiewicz/amy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pbanaszkiewicz/amy/merges","archive_url":"https://api.github.com/repos/pbanaszkiewicz/amy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pbanaszkiewicz/amy/downloads","issues_url":"https://api.github.com/repos/pbanaszkiewicz/amy/issues{/number}","pulls_url":"https://api.github.com/repos/pbanaszkiewicz/amy/pulls{/number}","milestones_url":"https://api.github.com/repos/pbanaszkiewicz/amy/milestones{/number}","notifications_url":"https://api.github.com/repos/pbanaszkiewicz/amy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pbanaszkiewicz/amy/labels{/name}","releases_url":"https://api.github.com/repos/pbanaszkiewicz/amy/releases{/id}","created_at":"2014-12-14T19:25:22Z","updated_at":"2015-05-08T17:10:25Z","pushed_at":"2015-07-17T12:21:28Z","git_url":"git://github.com/pbanaszkiewicz/amy.git","ssh_url":"git@github.com:pbanaszkiewicz/amy.git","clone_url":"https://github.com/pbanaszkiewicz/amy.git","svn_url":"https://github.com/pbanaszkiewicz/amy","homepage":null,"size":8865,"stargazers_count":0,"watchers_count":0,"language":"PLpgSQL","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"swcarpentry:master","ref":"master","sha":"44edb73a70c8f34ce14030468439298c58bd1919","user":{"login":"swcarpentry","id":2238358,"avatar_url":"https://avatars.githubusercontent.com/u/2238358?v=3","gravatar_id":"","url":"https://api.github.com/users/swcarpentry","html_url":"https://github.com/swcarpentry","followers_url":"https://api.github.com/users/swcarpentry/followers","following_url":"https://api.github.com/users/swcarpentry/following{/other_user}","gists_url":"https://api.github.com/users/swcarpentry/gists{/gist_id}","starred_url":"https://api.github.com/users/swcarpentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swcarpentry/subscriptions","organizations_url":"https://api.github.com/users/swcarpentry/orgs","repos_url":"https://api.github.com/users/swcarpentry/repos","events_url":"https://api.github.com/users/swcarpentry/events{/privacy}","received_events_url":"https://api.github.com/users/swcarpentry/received_events","type":"Organization","site_admin":false},"repo":{"id":27387287,"name":"amy","full_name":"swcarpentry/amy","owner":{"login":"swcarpentry","id":2238358,"avatar_url":"https://avatars.githubusercontent.com/u/2238358?v=3","gravatar_id":"","url":"https://api.github.com/users/swcarpentry","html_url":"https://github.com/swcarpentry","followers_url":"https://api.github.com/users/swcarpentry/followers","following_url":"https://api.github.com/users/swcarpentry/following{/other_user}","gists_url":"https://api.github.com/users/swcarpentry/gists{/gist_id}","starred_url":"https://api.github.com/users/swcarpentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swcarpentry/subscriptions","organizations_url":"https://api.github.com/users/swcarpentry/orgs","repos_url":"https://api.github.com/users/swcarpentry/repos","events_url":"https://api.github.com/users/swcarpentry/events{/privacy}","received_events_url":"https://api.github.com/users/swcarpentry/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/swcarpentry/amy","description":"A web-based workshop administration application built using Django.","fork":false,"url":"https://api.github.com/repos/swcarpentry/amy","forks_url":"https://api.github.com/repos/swcarpentry/amy/forks","keys_url":"https://api.github.com/repos/swcarpentry/amy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swcarpentry/amy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swcarpentry/amy/teams","hooks_url":"https://api.github.com/repos/swcarpentry/amy/hooks","issue_events_url":"https://api.github.com/repos/swcarpentry/amy/issues/events{/number}","events_url":"https://api.github.com/repos/swcarpentry/amy/events","assignees_url":"https://api.github.com/repos/swcarpentry/amy/assignees{/user}","branches_url":"https://api.github.com/repos/swcarpentry/amy/branches{/branch}","tags_url":"https://api.github.com/repos/swcarpentry/amy/tags","blobs_url":"https://api.github.com/repos/swcarpentry/amy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swcarpentry/amy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swcarpentry/amy/git/refs{/sha}","trees_url":"https://api.github.com/repos/swcarpentry/amy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swcarpentry/amy/statuses/{sha}","languages_url":"https://api.github.com/repos/swcarpentry/amy/languages","stargazers_url":"https://api.github.com/repos/swcarpentry/amy/stargazers","contributors_url":"https://api.github.com/repos/swcarpentry/amy/contributors","subscribers_url":"https://api.github.com/repos/swcarpentry/amy/subscribers","subscription_url":"https://api.github.com/repos/swcarpentry/amy/subscription","commits_url":"https://api.github.com/repos/swcarpentry/amy/commits{/sha}","git_commits_url":"https://api.github.com/repos/swcarpentry/amy/git/commits{/sha}","comments_url":"https://api.github.com/repos/swcarpentry/amy/comments{/number}","issue_comment_url":"https://api.github.com/repos/swcarpentry/amy/issues/comments{/number}","contents_url":"https://api.github.com/repos/swcarpentry/amy/contents/{+path}","compare_url":"https://api.github.com/repos/swcarpentry/amy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swcarpentry/amy/merges","archive_url":"https://api.github.com/repos/swcarpentry/amy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swcarpentry/amy/downloads","issues_url":"https://api.github.com/repos/swcarpentry/amy/issues{/number}","pulls_url":"https://api.github.com/repos/swcarpentry/amy/pulls{/number}","milestones_url":"https://api.github.com/repos/swcarpentry/amy/milestones{/number}","notifications_url":"https://api.github.com/repos/swcarpentry/amy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swcarpentry/amy/labels{/name}","releases_url":"https://api.github.com/repos/swcarpentry/amy/releases{/id}","created_at":"2014-12-01T16:07:14Z","updated_at":"2015-06-20T16:05:15Z","pushed_at":"2015-07-17T17:06:09Z","git_url":"git://github.com/swcarpentry/amy.git","ssh_url":"git@github.com:swcarpentry/amy.git","clone_url":"https://github.com/swcarpentry/amy.git","svn_url":"https://github.com/swcarpentry/amy","homepage":null,"size":11047,"stargazers_count":25,"watchers_count":25,"language":"PLpgSQL","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":36,"forks":31,"open_issues":36,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/swcarpentry/amy/pulls/426"},"html":{"href":"https://github.com/swcarpentry/amy/pull/426"},"issue":{"href":"https://api.github.com/repos/swcarpentry/amy/issues/426"},"comments":{"href":"https://api.github.com/repos/swcarpentry/amy/issues/426/comments"},"review_comments":{"href":"https://api.github.com/repos/swcarpentry/amy/pulls/426/comments"},"review_comment":{"href":"https://api.github.com/repos/swcarpentry/amy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/swcarpentry/amy/pulls/426/commits"},"statuses":{"href":"https://api.github.com/repos/swcarpentry/amy/statuses/885539ab77657cf2c0f3e3cc65686ec5f48cff6b"}}}}