{"action":"created","comment":{"url":"https://api.github.com/repos/serashioda/http-server/pulls/comments/92930868","pull_request_review_id":13454686,"id":92930868,"diff_hunk":"@@ -0,0 +1,79 @@\n+# # -*- coding: utf-8 -*-\n+\"\"\"Test client socket with various messages.\"\"\"\n+\n+\n+def test_response_ok():\n+    \"\"\"Test response_ok.\"\"\"\n+    from server import response_ok\n+    result = response_ok()\n+    assert result == 'HTTP/1.1 200 OK\\r\\nContent-Type: text/plain; charset=utf-8\\r\\n\\r\\n'\n+\n+\n+def test_response_error():\n+    \"\"\"Test response error.\"\"\"\n+    from server import response_error\n+    result = response_error()\n+    assert result == 'HTTP/1.1 500 Internal Server Error\\r\\nContent-Type: text/plain; charset=utf-8\\r\\n\\r\\n'\n+\n+\n+def test_client_for_ok_response():\n+    \"\"\"Test for ok response from server.\"\"\"\n+    from client import create_client_socket\n+    response = create_client_socket(\"Apples are rotten\")\n+    assert response == 'HTTP/1.1 200 OK\\r\\nContent-Type: text/plain; charset=utf-8\\r\\n\\r\\nApples are rotten'\n+\n+\n+def test_client_for_ok_response_eight():\n+    \"\"\"Test for ok response from server eight characters.\"\"\"\n+    from client import create_client_socket\n+    response = create_client_socket(\"12345678\")\n+    assert response == 'HTTP/1.1 200 OK\\r\\nContent-Type: text/plain; charset=utf-8\\r\\n\\r\\n12345678'\n+\n+\n+def test_client_for_ok_response_empty():\n+    \"\"\"Test for ok response from server with empty message.\"\"\"\n+    from client import create_client_socket\n+    response = create_client_socket(\"\")\n+    assert response == 'HTTP/1.1 200 OK\\r\\nContent-Type: text/plain; charset=utf-8\\r\\n\\r\\n'\n+\n+\n+def test_client_for_ok_response_non_ascii():\n+    \"\"\"Test for ok response from server non ascii.\"\"\"\n+    from client import create_client_socket\n+    response = create_client_socket(u\"non-ascii¡©\")","path":"src/tests/test_servers.py","position":43,"original_position":43,"commit_id":"ddfed9888ffee439e66fb583711743fa21fdcf26","original_commit_id":"ddfed9888ffee439e66fb583711743fa21fdcf26","user":{"login":"WillWeatherford","id":7210312,"avatar_url":"https://avatars.githubusercontent.com/u/7210312?v=3","gravatar_id":"","url":"https://api.github.com/users/WillWeatherford","html_url":"https://github.com/WillWeatherford","followers_url":"https://api.github.com/users/WillWeatherford/followers","following_url":"https://api.github.com/users/WillWeatherford/following{/other_user}","gists_url":"https://api.github.com/users/WillWeatherford/gists{/gist_id}","starred_url":"https://api.github.com/users/WillWeatherford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WillWeatherford/subscriptions","organizations_url":"https://api.github.com/users/WillWeatherford/orgs","repos_url":"https://api.github.com/users/WillWeatherford/repos","events_url":"https://api.github.com/users/WillWeatherford/events{/privacy}","received_events_url":"https://api.github.com/users/WillWeatherford/received_events","type":"User","site_admin":false},"body":"Rather than forcing string literals to unicode with the `u` prefix, you can use `from __future__ import unicode_literals` to ensure unicode string literals in both Python 2 and Python 3. I find this extremely useful to maintain consistency between the two versions.","created_at":"2016-12-17T23:30:07Z","updated_at":"2016-12-17T23:30:07Z","html_url":"https://github.com/serashioda/http-server/pull/2#discussion_r92930868","pull_request_url":"https://api.github.com/repos/serashioda/http-server/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/serashioda/http-server/pulls/comments/92930868"},"html":{"href":"https://github.com/serashioda/http-server/pull/2#discussion_r92930868"},"pull_request":{"href":"https://api.github.com/repos/serashioda/http-server/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/serashioda/http-server/pulls/2","id":98256975,"html_url":"https://github.com/serashioda/http-server/pull/2","diff_url":"https://github.com/serashioda/http-server/pull/2.diff","patch_url":"https://github.com/serashioda/http-server/pull/2.patch","issue_url":"https://api.github.com/repos/serashioda/http-server/issues/2","number":2,"state":"open","locked":false,"title":"Step1","user":{"login":"julienawilson","id":20971673,"avatar_url":"https://avatars.githubusercontent.com/u/20971673?v=3","gravatar_id":"","url":"https://api.github.com/users/julienawilson","html_url":"https://github.com/julienawilson","followers_url":"https://api.github.com/users/julienawilson/followers","following_url":"https://api.github.com/users/julienawilson/following{/other_user}","gists_url":"https://api.github.com/users/julienawilson/gists{/gist_id}","starred_url":"https://api.github.com/users/julienawilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julienawilson/subscriptions","organizations_url":"https://api.github.com/users/julienawilson/orgs","repos_url":"https://api.github.com/users/julienawilson/repos","events_url":"https://api.github.com/users/julienawilson/events{/privacy}","received_events_url":"https://api.github.com/users/julienawilson/received_events","type":"User","site_admin":false},"body":"Step 1 for HTTP server","created_at":"2016-12-16T00:14:48Z","updated_at":"2016-12-17T23:30:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2faa3acb6a5be199cde03178b9d056c3e4664878","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/serashioda/http-server/pulls/2/commits","review_comments_url":"https://api.github.com/repos/serashioda/http-server/pulls/2/comments","review_comment_url":"https://api.github.com/repos/serashioda/http-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/serashioda/http-server/issues/2/comments","statuses_url":"https://api.github.com/repos/serashioda/http-server/statuses/ddfed9888ffee439e66fb583711743fa21fdcf26","head":{"label":"serashioda:step1","ref":"step1","sha":"ddfed9888ffee439e66fb583711743fa21fdcf26","user":{"login":"serashioda","id":19750112,"avatar_url":"https://avatars.githubusercontent.com/u/19750112?v=3","gravatar_id":"","url":"https://api.github.com/users/serashioda","html_url":"https://github.com/serashioda","followers_url":"https://api.github.com/users/serashioda/followers","following_url":"https://api.github.com/users/serashioda/following{/other_user}","gists_url":"https://api.github.com/users/serashioda/gists{/gist_id}","starred_url":"https://api.github.com/users/serashioda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serashioda/subscriptions","organizations_url":"https://api.github.com/users/serashioda/orgs","repos_url":"https://api.github.com/users/serashioda/repos","events_url":"https://api.github.com/users/serashioda/events{/privacy}","received_events_url":"https://api.github.com/users/serashioda/received_events","type":"User","site_admin":false},"repo":{"id":76307161,"name":"http-server","full_name":"serashioda/http-server","owner":{"login":"serashioda","id":19750112,"avatar_url":"https://avatars.githubusercontent.com/u/19750112?v=3","gravatar_id":"","url":"https://api.github.com/users/serashioda","html_url":"https://github.com/serashioda","followers_url":"https://api.github.com/users/serashioda/followers","following_url":"https://api.github.com/users/serashioda/following{/other_user}","gists_url":"https://api.github.com/users/serashioda/gists{/gist_id}","starred_url":"https://api.github.com/users/serashioda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serashioda/subscriptions","organizations_url":"https://api.github.com/users/serashioda/orgs","repos_url":"https://api.github.com/users/serashioda/repos","events_url":"https://api.github.com/users/serashioda/events{/privacy}","received_events_url":"https://api.github.com/users/serashioda/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/serashioda/http-server","description":null,"fork":false,"url":"https://api.github.com/repos/serashioda/http-server","forks_url":"https://api.github.com/repos/serashioda/http-server/forks","keys_url":"https://api.github.com/repos/serashioda/http-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/serashioda/http-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/serashioda/http-server/teams","hooks_url":"https://api.github.com/repos/serashioda/http-server/hooks","issue_events_url":"https://api.github.com/repos/serashioda/http-server/issues/events{/number}","events_url":"https://api.github.com/repos/serashioda/http-server/events","assignees_url":"https://api.github.com/repos/serashioda/http-server/assignees{/user}","branches_url":"https://api.github.com/repos/serashioda/http-server/branches{/branch}","tags_url":"https://api.github.com/repos/serashioda/http-server/tags","blobs_url":"https://api.github.com/repos/serashioda/http-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/serashioda/http-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/serashioda/http-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/serashioda/http-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/serashioda/http-server/statuses/{sha}","languages_url":"https://api.github.com/repos/serashioda/http-server/languages","stargazers_url":"https://api.github.com/repos/serashioda/http-server/stargazers","contributors_url":"https://api.github.com/repos/serashioda/http-server/contributors","subscribers_url":"https://api.github.com/repos/serashioda/http-server/subscribers","subscription_url":"https://api.github.com/repos/serashioda/http-server/subscription","commits_url":"https://api.github.com/repos/serashioda/http-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/serashioda/http-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/serashioda/http-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/serashioda/http-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/serashioda/http-server/contents/{+path}","compare_url":"https://api.github.com/repos/serashioda/http-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/serashioda/http-server/merges","archive_url":"https://api.github.com/repos/serashioda/http-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/serashioda/http-server/downloads","issues_url":"https://api.github.com/repos/serashioda/http-server/issues{/number}","pulls_url":"https://api.github.com/repos/serashioda/http-server/pulls{/number}","milestones_url":"https://api.github.com/repos/serashioda/http-server/milestones{/number}","notifications_url":"https://api.github.com/repos/serashioda/http-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/serashioda/http-server/labels{/name}","releases_url":"https://api.github.com/repos/serashioda/http-server/releases{/id}","deployments_url":"https://api.github.com/repos/serashioda/http-server/deployments","created_at":"2016-12-13T00:20:56Z","updated_at":"2016-12-13T00:20:56Z","pushed_at":"2016-12-17T23:22:46Z","git_url":"git://github.com/serashioda/http-server.git","ssh_url":"git@github.com:serashioda/http-server.git","clone_url":"https://github.com/serashioda/http-server.git","svn_url":"https://github.com/serashioda/http-server","homepage":null,"size":21,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"serashioda:master","ref":"master","sha":"c6fe26bca958eeceb091d68dcf28b1b90fa3c40f","user":{"login":"serashioda","id":19750112,"avatar_url":"https://avatars.githubusercontent.com/u/19750112?v=3","gravatar_id":"","url":"https://api.github.com/users/serashioda","html_url":"https://github.com/serashioda","followers_url":"https://api.github.com/users/serashioda/followers","following_url":"https://api.github.com/users/serashioda/following{/other_user}","gists_url":"https://api.github.com/users/serashioda/gists{/gist_id}","starred_url":"https://api.github.com/users/serashioda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serashioda/subscriptions","organizations_url":"https://api.github.com/users/serashioda/orgs","repos_url":"https://api.github.com/users/serashioda/repos","events_url":"https://api.github.com/users/serashioda/events{/privacy}","received_events_url":"https://api.github.com/users/serashioda/received_events","type":"User","site_admin":false},"repo":{"id":76307161,"name":"http-server","full_name":"serashioda/http-server","owner":{"login":"serashioda","id":19750112,"avatar_url":"https://avatars.githubusercontent.com/u/19750112?v=3","gravatar_id":"","url":"https://api.github.com/users/serashioda","html_url":"https://github.com/serashioda","followers_url":"https://api.github.com/users/serashioda/followers","following_url":"https://api.github.com/users/serashioda/following{/other_user}","gists_url":"https://api.github.com/users/serashioda/gists{/gist_id}","starred_url":"https://api.github.com/users/serashioda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serashioda/subscriptions","organizations_url":"https://api.github.com/users/serashioda/orgs","repos_url":"https://api.github.com/users/serashioda/repos","events_url":"https://api.github.com/users/serashioda/events{/privacy}","received_events_url":"https://api.github.com/users/serashioda/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/serashioda/http-server","description":null,"fork":false,"url":"https://api.github.com/repos/serashioda/http-server","forks_url":"https://api.github.com/repos/serashioda/http-server/forks","keys_url":"https://api.github.com/repos/serashioda/http-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/serashioda/http-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/serashioda/http-server/teams","hooks_url":"https://api.github.com/repos/serashioda/http-server/hooks","issue_events_url":"https://api.github.com/repos/serashioda/http-server/issues/events{/number}","events_url":"https://api.github.com/repos/serashioda/http-server/events","assignees_url":"https://api.github.com/repos/serashioda/http-server/assignees{/user}","branches_url":"https://api.github.com/repos/serashioda/http-server/branches{/branch}","tags_url":"https://api.github.com/repos/serashioda/http-server/tags","blobs_url":"https://api.github.com/repos/serashioda/http-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/serashioda/http-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/serashioda/http-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/serashioda/http-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/serashioda/http-server/statuses/{sha}","languages_url":"https://api.github.com/repos/serashioda/http-server/languages","stargazers_url":"https://api.github.com/repos/serashioda/http-server/stargazers","contributors_url":"https://api.github.com/repos/serashioda/http-server/contributors","subscribers_url":"https://api.github.com/repos/serashioda/http-server/subscribers","subscription_url":"https://api.github.com/repos/serashioda/http-server/subscription","commits_url":"https://api.github.com/repos/serashioda/http-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/serashioda/http-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/serashioda/http-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/serashioda/http-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/serashioda/http-server/contents/{+path}","compare_url":"https://api.github.com/repos/serashioda/http-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/serashioda/http-server/merges","archive_url":"https://api.github.com/repos/serashioda/http-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/serashioda/http-server/downloads","issues_url":"https://api.github.com/repos/serashioda/http-server/issues{/number}","pulls_url":"https://api.github.com/repos/serashioda/http-server/pulls{/number}","milestones_url":"https://api.github.com/repos/serashioda/http-server/milestones{/number}","notifications_url":"https://api.github.com/repos/serashioda/http-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/serashioda/http-server/labels{/name}","releases_url":"https://api.github.com/repos/serashioda/http-server/releases{/id}","deployments_url":"https://api.github.com/repos/serashioda/http-server/deployments","created_at":"2016-12-13T00:20:56Z","updated_at":"2016-12-13T00:20:56Z","pushed_at":"2016-12-17T23:22:46Z","git_url":"git://github.com/serashioda/http-server.git","ssh_url":"git@github.com:serashioda/http-server.git","clone_url":"https://github.com/serashioda/http-server.git","svn_url":"https://github.com/serashioda/http-server","homepage":null,"size":21,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/serashioda/http-server/pulls/2"},"html":{"href":"https://github.com/serashioda/http-server/pull/2"},"issue":{"href":"https://api.github.com/repos/serashioda/http-server/issues/2"},"comments":{"href":"https://api.github.com/repos/serashioda/http-server/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/serashioda/http-server/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/serashioda/http-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/serashioda/http-server/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/serashioda/http-server/statuses/ddfed9888ffee439e66fb583711743fa21fdcf26"}}}}
{"actor":{"display_login":"WillWeatherford"}}