{"action":"created","comment":{"url":"https://api.github.com/repos/welliam/http-server/pulls/comments/75585932","id":75585932,"diff_hunk":"@@ -141,3 +170,55 @@ def test_parse_uri(uri):\n     from server import parse_request\n     request = 'GET {} HTTP/1.1\\r\\nHost: www.example.org\\r\\n'.format(uri)\n     assert parse_request(request) == uri\n+\n+\n+@pytest.mark.parametrize('path, isvalid', PATH_TABLE)\n+def test_valid_path(path, isvalid):\n+    from server import verify_path, HTTPException\n+    if isvalid:\n+        verify_path(path)\n+        assert True\n+    else:\n+        with pytest.raises(HTTPException):\n+            verify_path(path)\n+\n+\n+@pytest.mark.parametrize('paths', HTML_TABLE)\n+def test_format_dir(paths):\n+    from server import format_dir\n+    result = format_dir(paths)\n+    assert all(path in result for path in paths)\n+    assert result.startswith('<ul>')\n+    assert result.endswith('</ul>')\n+\n+\n+def test_path_content():\n+    from server import path_content\n+    assert path_content('./test/temp_file.txt') == b'12345678\\n'\n+\n+\n+def test_path_content_dir():\n+    from server import path_content\n+    assert b'temp_file.txt' in path_content('./test/')\n+\n+\n+def test_path_content_error():\n+    from server import path_content, HTTPException\n+    with pytest.raises(HTTPException):\n+        path_content('non-existent-path')","path":"src/test_http.py","position":115,"original_position":115,"commit_id":"2f11f86d38e2fce28dfee33c2f967dea7560ec24","original_commit_id":"2f11f86d38e2fce28dfee33c2f967dea7560ec24","user":{"login":"cewing","id":417109,"avatar_url":"https://avatars.githubusercontent.com/u/417109?v=3","gravatar_id":"","url":"https://api.github.com/users/cewing","html_url":"https://github.com/cewing","followers_url":"https://api.github.com/users/cewing/followers","following_url":"https://api.github.com/users/cewing/following{/other_user}","gists_url":"https://api.github.com/users/cewing/gists{/gist_id}","starred_url":"https://api.github.com/users/cewing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cewing/subscriptions","organizations_url":"https://api.github.com/users/cewing/orgs","repos_url":"https://api.github.com/users/cewing/repos","events_url":"https://api.github.com/users/cewing/events{/privacy}","received_events_url":"https://api.github.com/users/cewing/received_events","type":"User","site_admin":false},"body":"I'd like to see more tests of the failure conditions of your code.  ","created_at":"2016-08-20T22:43:35Z","updated_at":"2016-08-20T22:43:35Z","html_url":"https://github.com/welliam/http-server/pull/6#discussion_r75585932","pull_request_url":"https://api.github.com/repos/welliam/http-server/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/welliam/http-server/pulls/comments/75585932"},"html":{"href":"https://github.com/welliam/http-server/pull/6#discussion_r75585932"},"pull_request":{"href":"https://api.github.com/repos/welliam/http-server/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/welliam/http-server/pulls/6","id":81959573,"html_url":"https://github.com/welliam/http-server/pull/6","diff_url":"https://github.com/welliam/http-server/pull/6.diff","patch_url":"https://github.com/welliam/http-server/pull/6.patch","issue_url":"https://api.github.com/repos/welliam/http-server/issues/6","number":6,"state":"open","locked":false,"title":"Step3","user":{"login":"steventhan","id":18476667,"avatar_url":"https://avatars.githubusercontent.com/u/18476667?v=3","gravatar_id":"","url":"https://api.github.com/users/steventhan","html_url":"https://github.com/steventhan","followers_url":"https://api.github.com/users/steventhan/followers","following_url":"https://api.github.com/users/steventhan/following{/other_user}","gists_url":"https://api.github.com/users/steventhan/gists{/gist_id}","starred_url":"https://api.github.com/users/steventhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steventhan/subscriptions","organizations_url":"https://api.github.com/users/steventhan/orgs","repos_url":"https://api.github.com/users/steventhan/repos","events_url":"https://api.github.com/users/steventhan/events{/privacy}","received_events_url":"https://api.github.com/users/steventhan/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-19T10:28:48Z","updated_at":"2016-08-20T22:43:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93afa1ee844a4a66b8adbebc45fc35a16899a180","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/welliam/http-server/pulls/6/commits","review_comments_url":"https://api.github.com/repos/welliam/http-server/pulls/6/comments","review_comment_url":"https://api.github.com/repos/welliam/http-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/welliam/http-server/issues/6/comments","statuses_url":"https://api.github.com/repos/welliam/http-server/statuses/2f11f86d38e2fce28dfee33c2f967dea7560ec24","head":{"label":"welliam:step3","ref":"step3","sha":"2f11f86d38e2fce28dfee33c2f967dea7560ec24","user":{"login":"welliam","id":4933194,"avatar_url":"https://avatars.githubusercontent.com/u/4933194?v=3","gravatar_id":"","url":"https://api.github.com/users/welliam","html_url":"https://github.com/welliam","followers_url":"https://api.github.com/users/welliam/followers","following_url":"https://api.github.com/users/welliam/following{/other_user}","gists_url":"https://api.github.com/users/welliam/gists{/gist_id}","starred_url":"https://api.github.com/users/welliam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/welliam/subscriptions","organizations_url":"https://api.github.com/users/welliam/orgs","repos_url":"https://api.github.com/users/welliam/repos","events_url":"https://api.github.com/users/welliam/events{/privacy}","received_events_url":"https://api.github.com/users/welliam/received_events","type":"User","site_admin":false},"repo":{"id":65769611,"name":"http-server","full_name":"welliam/http-server","owner":{"login":"welliam","id":4933194,"avatar_url":"https://avatars.githubusercontent.com/u/4933194?v=3","gravatar_id":"","url":"https://api.github.com/users/welliam","html_url":"https://github.com/welliam","followers_url":"https://api.github.com/users/welliam/followers","following_url":"https://api.github.com/users/welliam/following{/other_user}","gists_url":"https://api.github.com/users/welliam/gists{/gist_id}","starred_url":"https://api.github.com/users/welliam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/welliam/subscriptions","organizations_url":"https://api.github.com/users/welliam/orgs","repos_url":"https://api.github.com/users/welliam/repos","events_url":"https://api.github.com/users/welliam/events{/privacy}","received_events_url":"https://api.github.com/users/welliam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/welliam/http-server","description":"HTTP server for Python 401","fork":false,"url":"https://api.github.com/repos/welliam/http-server","forks_url":"https://api.github.com/repos/welliam/http-server/forks","keys_url":"https://api.github.com/repos/welliam/http-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/welliam/http-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/welliam/http-server/teams","hooks_url":"https://api.github.com/repos/welliam/http-server/hooks","issue_events_url":"https://api.github.com/repos/welliam/http-server/issues/events{/number}","events_url":"https://api.github.com/repos/welliam/http-server/events","assignees_url":"https://api.github.com/repos/welliam/http-server/assignees{/user}","branches_url":"https://api.github.com/repos/welliam/http-server/branches{/branch}","tags_url":"https://api.github.com/repos/welliam/http-server/tags","blobs_url":"https://api.github.com/repos/welliam/http-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/welliam/http-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/welliam/http-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/welliam/http-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/welliam/http-server/statuses/{sha}","languages_url":"https://api.github.com/repos/welliam/http-server/languages","stargazers_url":"https://api.github.com/repos/welliam/http-server/stargazers","contributors_url":"https://api.github.com/repos/welliam/http-server/contributors","subscribers_url":"https://api.github.com/repos/welliam/http-server/subscribers","subscription_url":"https://api.github.com/repos/welliam/http-server/subscription","commits_url":"https://api.github.com/repos/welliam/http-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/welliam/http-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/welliam/http-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/welliam/http-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/welliam/http-server/contents/{+path}","compare_url":"https://api.github.com/repos/welliam/http-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/welliam/http-server/merges","archive_url":"https://api.github.com/repos/welliam/http-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/welliam/http-server/downloads","issues_url":"https://api.github.com/repos/welliam/http-server/issues{/number}","pulls_url":"https://api.github.com/repos/welliam/http-server/pulls{/number}","milestones_url":"https://api.github.com/repos/welliam/http-server/milestones{/number}","notifications_url":"https://api.github.com/repos/welliam/http-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/welliam/http-server/labels{/name}","releases_url":"https://api.github.com/repos/welliam/http-server/releases{/id}","deployments_url":"https://api.github.com/repos/welliam/http-server/deployments","created_at":"2016-08-15T22:37:12Z","updated_at":"2016-08-17T16:31:30Z","pushed_at":"2016-08-19T18:26:48Z","git_url":"git://github.com/welliam/http-server.git","ssh_url":"git@github.com:welliam/http-server.git","clone_url":"https://github.com/welliam/http-server.git","svn_url":"https://github.com/welliam/http-server","homepage":"","size":191,"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":"welliam:master","ref":"master","sha":"273c857225d9bfa8b2309f35a149ed67148afeae","user":{"login":"welliam","id":4933194,"avatar_url":"https://avatars.githubusercontent.com/u/4933194?v=3","gravatar_id":"","url":"https://api.github.com/users/welliam","html_url":"https://github.com/welliam","followers_url":"https://api.github.com/users/welliam/followers","following_url":"https://api.github.com/users/welliam/following{/other_user}","gists_url":"https://api.github.com/users/welliam/gists{/gist_id}","starred_url":"https://api.github.com/users/welliam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/welliam/subscriptions","organizations_url":"https://api.github.com/users/welliam/orgs","repos_url":"https://api.github.com/users/welliam/repos","events_url":"https://api.github.com/users/welliam/events{/privacy}","received_events_url":"https://api.github.com/users/welliam/received_events","type":"User","site_admin":false},"repo":{"id":65769611,"name":"http-server","full_name":"welliam/http-server","owner":{"login":"welliam","id":4933194,"avatar_url":"https://avatars.githubusercontent.com/u/4933194?v=3","gravatar_id":"","url":"https://api.github.com/users/welliam","html_url":"https://github.com/welliam","followers_url":"https://api.github.com/users/welliam/followers","following_url":"https://api.github.com/users/welliam/following{/other_user}","gists_url":"https://api.github.com/users/welliam/gists{/gist_id}","starred_url":"https://api.github.com/users/welliam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/welliam/subscriptions","organizations_url":"https://api.github.com/users/welliam/orgs","repos_url":"https://api.github.com/users/welliam/repos","events_url":"https://api.github.com/users/welliam/events{/privacy}","received_events_url":"https://api.github.com/users/welliam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/welliam/http-server","description":"HTTP server for Python 401","fork":false,"url":"https://api.github.com/repos/welliam/http-server","forks_url":"https://api.github.com/repos/welliam/http-server/forks","keys_url":"https://api.github.com/repos/welliam/http-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/welliam/http-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/welliam/http-server/teams","hooks_url":"https://api.github.com/repos/welliam/http-server/hooks","issue_events_url":"https://api.github.com/repos/welliam/http-server/issues/events{/number}","events_url":"https://api.github.com/repos/welliam/http-server/events","assignees_url":"https://api.github.com/repos/welliam/http-server/assignees{/user}","branches_url":"https://api.github.com/repos/welliam/http-server/branches{/branch}","tags_url":"https://api.github.com/repos/welliam/http-server/tags","blobs_url":"https://api.github.com/repos/welliam/http-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/welliam/http-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/welliam/http-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/welliam/http-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/welliam/http-server/statuses/{sha}","languages_url":"https://api.github.com/repos/welliam/http-server/languages","stargazers_url":"https://api.github.com/repos/welliam/http-server/stargazers","contributors_url":"https://api.github.com/repos/welliam/http-server/contributors","subscribers_url":"https://api.github.com/repos/welliam/http-server/subscribers","subscription_url":"https://api.github.com/repos/welliam/http-server/subscription","commits_url":"https://api.github.com/repos/welliam/http-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/welliam/http-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/welliam/http-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/welliam/http-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/welliam/http-server/contents/{+path}","compare_url":"https://api.github.com/repos/welliam/http-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/welliam/http-server/merges","archive_url":"https://api.github.com/repos/welliam/http-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/welliam/http-server/downloads","issues_url":"https://api.github.com/repos/welliam/http-server/issues{/number}","pulls_url":"https://api.github.com/repos/welliam/http-server/pulls{/number}","milestones_url":"https://api.github.com/repos/welliam/http-server/milestones{/number}","notifications_url":"https://api.github.com/repos/welliam/http-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/welliam/http-server/labels{/name}","releases_url":"https://api.github.com/repos/welliam/http-server/releases{/id}","deployments_url":"https://api.github.com/repos/welliam/http-server/deployments","created_at":"2016-08-15T22:37:12Z","updated_at":"2016-08-17T16:31:30Z","pushed_at":"2016-08-19T18:26:48Z","git_url":"git://github.com/welliam/http-server.git","ssh_url":"git@github.com:welliam/http-server.git","clone_url":"https://github.com/welliam/http-server.git","svn_url":"https://github.com/welliam/http-server","homepage":"","size":191,"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/welliam/http-server/pulls/6"},"html":{"href":"https://github.com/welliam/http-server/pull/6"},"issue":{"href":"https://api.github.com/repos/welliam/http-server/issues/6"},"comments":{"href":"https://api.github.com/repos/welliam/http-server/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/welliam/http-server/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/welliam/http-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/welliam/http-server/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/welliam/http-server/statuses/2f11f86d38e2fce28dfee33c2f967dea7560ec24"}}}}
{"actor":{"display_login":"cewing"}}