{"action":"created","comment":{"url":"https://api.github.com/repos/MigrantJ/data-structures/pulls/comments/33880961","id":33880961,"diff_hunk":"@@ -0,0 +1,86 @@\n+from __future__ import unicode_literals\n+import pytest\n+from priorityq import Priorityq\n+\n+\n+@pytest.fixture()\n+def empty_q():\n+    return Priorityq()\n+\n+\n+def test_pop_empty(empty_q):\n+    with pytest.raises(LookupError):\n+        empty_q.pop()\n+\n+\n+def test_insert_and_pop_once(empty_q):\n+    empty_q.insert(1, 1)\n+    assert empty_q.pop() == 1\n+    empty_q.insert(0, 2)\n+    assert empty_q.pop() == 2\n+\n+\n+def test_priority(empty_q):\n+    empty_q.insert(100, 0)\n+    empty_q.insert(1, 2)\n+    assert empty_q.pop() == 2\n+\n+\n+def test_equal_priority(empty_q):\n+    empty_q.insert(0, 0)\n+    empty_q.insert(0, 1)\n+    empty_q.insert(0, 2)\n+    empty_q.insert(0, 3)\n+    empty_q.insert(0, 4)\n+    empty_q.insert(0, 5)\n+    assert empty_q.pop() == 0\n+    assert empty_q.pop() == 1\n+    assert empty_q.pop() == 2\n+    assert empty_q.pop() == 3\n+    assert empty_q.pop() == 4\n+    assert empty_q.pop() == 5","path":"binheap/test_priorityq.py","position":41,"original_position":41,"commit_id":"6c61157651e008a207d2d0c5780cdb59818f726e","original_commit_id":"6c61157651e008a207d2d0c5780cdb59818f726e","user":{"login":"Jakeand3rson","id":4807654,"avatar_url":"https://avatars.githubusercontent.com/u/4807654?v=3","gravatar_id":"","url":"https://api.github.com/users/Jakeand3rson","html_url":"https://github.com/Jakeand3rson","followers_url":"https://api.github.com/users/Jakeand3rson/followers","following_url":"https://api.github.com/users/Jakeand3rson/following{/other_user}","gists_url":"https://api.github.com/users/Jakeand3rson/gists{/gist_id}","starred_url":"https://api.github.com/users/Jakeand3rson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jakeand3rson/subscriptions","organizations_url":"https://api.github.com/users/Jakeand3rson/orgs","repos_url":"https://api.github.com/users/Jakeand3rson/repos","events_url":"https://api.github.com/users/Jakeand3rson/events{/privacy}","received_events_url":"https://api.github.com/users/Jakeand3rson/received_events","type":"User","site_admin":false},"body":"There is a way to make this a 4 line test.. Give it a shot..","created_at":"2015-07-03T21:17:29Z","updated_at":"2015-07-03T21:17:29Z","html_url":"https://github.com/MigrantJ/data-structures/pull/7#discussion_r33880961","pull_request_url":"https://api.github.com/repos/MigrantJ/data-structures/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/MigrantJ/data-structures/pulls/comments/33880961"},"html":{"href":"https://github.com/MigrantJ/data-structures/pull/7#discussion_r33880961"},"pull_request":{"href":"https://api.github.com/repos/MigrantJ/data-structures/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/MigrantJ/data-structures/pulls/7","id":39132315,"html_url":"https://github.com/MigrantJ/data-structures/pull/7","diff_url":"https://github.com/MigrantJ/data-structures/pull/7.diff","patch_url":"https://github.com/MigrantJ/data-structures/pull/7.patch","issue_url":"https://api.github.com/repos/MigrantJ/data-structures/issues/7","number":7,"state":"open","locked":false,"title":"Priorityq","user":{"login":"MigrantJ","id":7929451,"avatar_url":"https://avatars.githubusercontent.com/u/7929451?v=3","gravatar_id":"","url":"https://api.github.com/users/MigrantJ","html_url":"https://github.com/MigrantJ","followers_url":"https://api.github.com/users/MigrantJ/followers","following_url":"https://api.github.com/users/MigrantJ/following{/other_user}","gists_url":"https://api.github.com/users/MigrantJ/gists{/gist_id}","starred_url":"https://api.github.com/users/MigrantJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MigrantJ/subscriptions","organizations_url":"https://api.github.com/users/MigrantJ/orgs","repos_url":"https://api.github.com/users/MigrantJ/repos","events_url":"https://api.github.com/users/MigrantJ/events{/privacy}","received_events_url":"https://api.github.com/users/MigrantJ/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-02T22:34:29Z","updated_at":"2015-07-03T21:17:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33566071a5ecf1361c276847b5b33285f25632bc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MigrantJ/data-structures/pulls/7/commits","review_comments_url":"https://api.github.com/repos/MigrantJ/data-structures/pulls/7/comments","review_comment_url":"https://api.github.com/repos/MigrantJ/data-structures/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MigrantJ/data-structures/issues/7/comments","statuses_url":"https://api.github.com/repos/MigrantJ/data-structures/statuses/6c61157651e008a207d2d0c5780cdb59818f726e","head":{"label":"MigrantJ:priorityq","ref":"priorityq","sha":"6c61157651e008a207d2d0c5780cdb59818f726e","user":{"login":"MigrantJ","id":7929451,"avatar_url":"https://avatars.githubusercontent.com/u/7929451?v=3","gravatar_id":"","url":"https://api.github.com/users/MigrantJ","html_url":"https://github.com/MigrantJ","followers_url":"https://api.github.com/users/MigrantJ/followers","following_url":"https://api.github.com/users/MigrantJ/following{/other_user}","gists_url":"https://api.github.com/users/MigrantJ/gists{/gist_id}","starred_url":"https://api.github.com/users/MigrantJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MigrantJ/subscriptions","organizations_url":"https://api.github.com/users/MigrantJ/orgs","repos_url":"https://api.github.com/users/MigrantJ/repos","events_url":"https://api.github.com/users/MigrantJ/events{/privacy}","received_events_url":"https://api.github.com/users/MigrantJ/received_events","type":"User","site_admin":false},"repo":{"id":38007587,"name":"data-structures","full_name":"MigrantJ/data-structures","owner":{"login":"MigrantJ","id":7929451,"avatar_url":"https://avatars.githubusercontent.com/u/7929451?v=3","gravatar_id":"","url":"https://api.github.com/users/MigrantJ","html_url":"https://github.com/MigrantJ","followers_url":"https://api.github.com/users/MigrantJ/followers","following_url":"https://api.github.com/users/MigrantJ/following{/other_user}","gists_url":"https://api.github.com/users/MigrantJ/gists{/gist_id}","starred_url":"https://api.github.com/users/MigrantJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MigrantJ/subscriptions","organizations_url":"https://api.github.com/users/MigrantJ/orgs","repos_url":"https://api.github.com/users/MigrantJ/repos","events_url":"https://api.github.com/users/MigrantJ/events{/privacy}","received_events_url":"https://api.github.com/users/MigrantJ/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MigrantJ/data-structures","description":"Sample code for a number of classic data structures implemented in Python","fork":false,"url":"https://api.github.com/repos/MigrantJ/data-structures","forks_url":"https://api.github.com/repos/MigrantJ/data-structures/forks","keys_url":"https://api.github.com/repos/MigrantJ/data-structures/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MigrantJ/data-structures/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MigrantJ/data-structures/teams","hooks_url":"https://api.github.com/repos/MigrantJ/data-structures/hooks","issue_events_url":"https://api.github.com/repos/MigrantJ/data-structures/issues/events{/number}","events_url":"https://api.github.com/repos/MigrantJ/data-structures/events","assignees_url":"https://api.github.com/repos/MigrantJ/data-structures/assignees{/user}","branches_url":"https://api.github.com/repos/MigrantJ/data-structures/branches{/branch}","tags_url":"https://api.github.com/repos/MigrantJ/data-structures/tags","blobs_url":"https://api.github.com/repos/MigrantJ/data-structures/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MigrantJ/data-structures/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MigrantJ/data-structures/git/refs{/sha}","trees_url":"https://api.github.com/repos/MigrantJ/data-structures/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MigrantJ/data-structures/statuses/{sha}","languages_url":"https://api.github.com/repos/MigrantJ/data-structures/languages","stargazers_url":"https://api.github.com/repos/MigrantJ/data-structures/stargazers","contributors_url":"https://api.github.com/repos/MigrantJ/data-structures/contributors","subscribers_url":"https://api.github.com/repos/MigrantJ/data-structures/subscribers","subscription_url":"https://api.github.com/repos/MigrantJ/data-structures/subscription","commits_url":"https://api.github.com/repos/MigrantJ/data-structures/commits{/sha}","git_commits_url":"https://api.github.com/repos/MigrantJ/data-structures/git/commits{/sha}","comments_url":"https://api.github.com/repos/MigrantJ/data-structures/comments{/number}","issue_comment_url":"https://api.github.com/repos/MigrantJ/data-structures/issues/comments{/number}","contents_url":"https://api.github.com/repos/MigrantJ/data-structures/contents/{+path}","compare_url":"https://api.github.com/repos/MigrantJ/data-structures/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MigrantJ/data-structures/merges","archive_url":"https://api.github.com/repos/MigrantJ/data-structures/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MigrantJ/data-structures/downloads","issues_url":"https://api.github.com/repos/MigrantJ/data-structures/issues{/number}","pulls_url":"https://api.github.com/repos/MigrantJ/data-structures/pulls{/number}","milestones_url":"https://api.github.com/repos/MigrantJ/data-structures/milestones{/number}","notifications_url":"https://api.github.com/repos/MigrantJ/data-structures/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MigrantJ/data-structures/labels{/name}","releases_url":"https://api.github.com/repos/MigrantJ/data-structures/releases{/id}","created_at":"2015-06-24T19:54:21Z","updated_at":"2015-06-25T20:57:12Z","pushed_at":"2015-07-02T22:34:29Z","git_url":"git://github.com/MigrantJ/data-structures.git","ssh_url":"git@github.com:MigrantJ/data-structures.git","clone_url":"https://github.com/MigrantJ/data-structures.git","svn_url":"https://github.com/MigrantJ/data-structures","homepage":null,"size":236,"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":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"MigrantJ:master","ref":"master","sha":"03005564b787ec906cc07958abbaafad0b6dbfd2","user":{"login":"MigrantJ","id":7929451,"avatar_url":"https://avatars.githubusercontent.com/u/7929451?v=3","gravatar_id":"","url":"https://api.github.com/users/MigrantJ","html_url":"https://github.com/MigrantJ","followers_url":"https://api.github.com/users/MigrantJ/followers","following_url":"https://api.github.com/users/MigrantJ/following{/other_user}","gists_url":"https://api.github.com/users/MigrantJ/gists{/gist_id}","starred_url":"https://api.github.com/users/MigrantJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MigrantJ/subscriptions","organizations_url":"https://api.github.com/users/MigrantJ/orgs","repos_url":"https://api.github.com/users/MigrantJ/repos","events_url":"https://api.github.com/users/MigrantJ/events{/privacy}","received_events_url":"https://api.github.com/users/MigrantJ/received_events","type":"User","site_admin":false},"repo":{"id":38007587,"name":"data-structures","full_name":"MigrantJ/data-structures","owner":{"login":"MigrantJ","id":7929451,"avatar_url":"https://avatars.githubusercontent.com/u/7929451?v=3","gravatar_id":"","url":"https://api.github.com/users/MigrantJ","html_url":"https://github.com/MigrantJ","followers_url":"https://api.github.com/users/MigrantJ/followers","following_url":"https://api.github.com/users/MigrantJ/following{/other_user}","gists_url":"https://api.github.com/users/MigrantJ/gists{/gist_id}","starred_url":"https://api.github.com/users/MigrantJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MigrantJ/subscriptions","organizations_url":"https://api.github.com/users/MigrantJ/orgs","repos_url":"https://api.github.com/users/MigrantJ/repos","events_url":"https://api.github.com/users/MigrantJ/events{/privacy}","received_events_url":"https://api.github.com/users/MigrantJ/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MigrantJ/data-structures","description":"Sample code for a number of classic data structures implemented in Python","fork":false,"url":"https://api.github.com/repos/MigrantJ/data-structures","forks_url":"https://api.github.com/repos/MigrantJ/data-structures/forks","keys_url":"https://api.github.com/repos/MigrantJ/data-structures/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MigrantJ/data-structures/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MigrantJ/data-structures/teams","hooks_url":"https://api.github.com/repos/MigrantJ/data-structures/hooks","issue_events_url":"https://api.github.com/repos/MigrantJ/data-structures/issues/events{/number}","events_url":"https://api.github.com/repos/MigrantJ/data-structures/events","assignees_url":"https://api.github.com/repos/MigrantJ/data-structures/assignees{/user}","branches_url":"https://api.github.com/repos/MigrantJ/data-structures/branches{/branch}","tags_url":"https://api.github.com/repos/MigrantJ/data-structures/tags","blobs_url":"https://api.github.com/repos/MigrantJ/data-structures/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MigrantJ/data-structures/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MigrantJ/data-structures/git/refs{/sha}","trees_url":"https://api.github.com/repos/MigrantJ/data-structures/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MigrantJ/data-structures/statuses/{sha}","languages_url":"https://api.github.com/repos/MigrantJ/data-structures/languages","stargazers_url":"https://api.github.com/repos/MigrantJ/data-structures/stargazers","contributors_url":"https://api.github.com/repos/MigrantJ/data-structures/contributors","subscribers_url":"https://api.github.com/repos/MigrantJ/data-structures/subscribers","subscription_url":"https://api.github.com/repos/MigrantJ/data-structures/subscription","commits_url":"https://api.github.com/repos/MigrantJ/data-structures/commits{/sha}","git_commits_url":"https://api.github.com/repos/MigrantJ/data-structures/git/commits{/sha}","comments_url":"https://api.github.com/repos/MigrantJ/data-structures/comments{/number}","issue_comment_url":"https://api.github.com/repos/MigrantJ/data-structures/issues/comments{/number}","contents_url":"https://api.github.com/repos/MigrantJ/data-structures/contents/{+path}","compare_url":"https://api.github.com/repos/MigrantJ/data-structures/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MigrantJ/data-structures/merges","archive_url":"https://api.github.com/repos/MigrantJ/data-structures/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MigrantJ/data-structures/downloads","issues_url":"https://api.github.com/repos/MigrantJ/data-structures/issues{/number}","pulls_url":"https://api.github.com/repos/MigrantJ/data-structures/pulls{/number}","milestones_url":"https://api.github.com/repos/MigrantJ/data-structures/milestones{/number}","notifications_url":"https://api.github.com/repos/MigrantJ/data-structures/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MigrantJ/data-structures/labels{/name}","releases_url":"https://api.github.com/repos/MigrantJ/data-structures/releases{/id}","created_at":"2015-06-24T19:54:21Z","updated_at":"2015-06-25T20:57:12Z","pushed_at":"2015-07-02T22:34:29Z","git_url":"git://github.com/MigrantJ/data-structures.git","ssh_url":"git@github.com:MigrantJ/data-structures.git","clone_url":"https://github.com/MigrantJ/data-structures.git","svn_url":"https://github.com/MigrantJ/data-structures","homepage":null,"size":236,"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":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MigrantJ/data-structures/pulls/7"},"html":{"href":"https://github.com/MigrantJ/data-structures/pull/7"},"issue":{"href":"https://api.github.com/repos/MigrantJ/data-structures/issues/7"},"comments":{"href":"https://api.github.com/repos/MigrantJ/data-structures/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/MigrantJ/data-structures/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/MigrantJ/data-structures/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MigrantJ/data-structures/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/MigrantJ/data-structures/statuses/6c61157651e008a207d2d0c5780cdb59818f726e"}}}}