{"action":"created","comment":{"url":"https://api.github.com/repos/slezica/python-frozendict/pulls/comments/82302406","pull_request_review_id":3220094,"id":82302406,"diff_hunk":"@@ -0,0 +1,131 @@\n+from unittest import TestCase\n+\n+from frozendict import frozendict, FrozenOrderedDict\n+\n+\n+class BaseTestCase(TestCase):\n+    def assertMappingEqual(self, m1, m2):\n+        # `assertDictEqual` will make a failing type check when comparing a `dict`\n+        # with a `frozendict`. Instead, we'll compare the item sets:\n+        self.assertSetEqual(set(m1.items()), set(m2.items()))\n+\n+    def assertRaisesAssignmentError(self, *args, **kwargs):\n+        self.assertRaisesRegexp(\n+            TypeError,\n+            r'object does not support item assignment',\n+            *args, **kwargs\n+        )\n+\n+\n+def setitem(dct, key, value):\n+    dct[key] = value\n+\n+\n+class TestFrozenDict(BaseTestCase):\n+    def test_assignment_fails(self):\n+        self.assertRaisesAssignmentError(setitem, frozendict(), 'key', 'value')\n+\n+    def test_init(self):\n+        frozendict()\n+\n+    def test_init_with_keys(self):\n+        fd = frozendict(a=0, b=1)\n+        self.assertMappingEqual(fd, dict(a=0, b=1))\n+\n+    def test_init_with_dict(self):\n+        fd = frozendict(dict(a=0, b=1))\n+        self.assertMappingEqual(fd, dict(a=0, b=1))\n+\n+    def test_init_with_dict_and_keys(self):\n+        fd = frozendict(dict(a=0, b=1), b=2, c=3)\n+        self.assertMappingEqual(fd, dict(a=0, b=2, c=3))\n+\n+    def test_getitem(self):\n+        fd = frozendict(key='value')\n+        self.assertEqual(fd['key'], 'value')\n+\n+    def test_copy(self):","path":"frozendict/tests.py","position":47,"original_position":47,"commit_id":"e38fc9213087038471c2f5128925a86b83f0848d","original_commit_id":"e38fc9213087038471c2f5128925a86b83f0848d","user":{"login":"ppolewicz","id":726553,"avatar_url":"https://avatars.githubusercontent.com/u/726553?v=3","gravatar_id":"","url":"https://api.github.com/users/ppolewicz","html_url":"https://github.com/ppolewicz","followers_url":"https://api.github.com/users/ppolewicz/followers","following_url":"https://api.github.com/users/ppolewicz/following{/other_user}","gists_url":"https://api.github.com/users/ppolewicz/gists{/gist_id}","starred_url":"https://api.github.com/users/ppolewicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppolewicz/subscriptions","organizations_url":"https://api.github.com/users/ppolewicz/orgs","repos_url":"https://api.github.com/users/ppolewicz/repos","events_url":"https://api.github.com/users/ppolewicz/events{/privacy}","received_events_url":"https://api.github.com/users/ppolewicz/received_events","type":"User","site_admin":false},"body":"this test doesn't check if the copy is actually the same object or not","created_at":"2016-10-06T22:55:41Z","updated_at":"2016-10-06T22:55:41Z","html_url":"https://github.com/slezica/python-frozendict/pull/15#discussion_r82302406","pull_request_url":"https://api.github.com/repos/slezica/python-frozendict/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/slezica/python-frozendict/pulls/comments/82302406"},"html":{"href":"https://github.com/slezica/python-frozendict/pull/15#discussion_r82302406"},"pull_request":{"href":"https://api.github.com/repos/slezica/python-frozendict/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/slezica/python-frozendict/pulls/15","id":88270887,"html_url":"https://github.com/slezica/python-frozendict/pull/15","diff_url":"https://github.com/slezica/python-frozendict/pull/15.diff","patch_url":"https://github.com/slezica/python-frozendict/pull/15.patch","issue_url":"https://api.github.com/repos/slezica/python-frozendict/issues/15","number":15,"state":"open","locked":false,"title":"Add tests","user":{"login":"slezica","id":321596,"avatar_url":"https://avatars.githubusercontent.com/u/321596?v=3","gravatar_id":"","url":"https://api.github.com/users/slezica","html_url":"https://github.com/slezica","followers_url":"https://api.github.com/users/slezica/followers","following_url":"https://api.github.com/users/slezica/following{/other_user}","gists_url":"https://api.github.com/users/slezica/gists{/gist_id}","starred_url":"https://api.github.com/users/slezica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slezica/subscriptions","organizations_url":"https://api.github.com/users/slezica/orgs","repos_url":"https://api.github.com/users/slezica/repos","events_url":"https://api.github.com/users/slezica/events{/privacy}","received_events_url":"https://api.github.com/users/slezica/received_events","type":"User","site_admin":false},"body":"@ppolewicz @lurch @eugene-eeo \r\n\r\nThis project is seeing some activity lately (yay), I think it's time to add some tests.\r\n\r\nI incorporated test cases written in an earlier fork, linked by @ppolewicz in https://github.com/slezica/python-frozendict/issues/14, but I'm torn between two positions: on one hand, the cases are pretty basic and not much is being actually tested, but on the other hand, most of the real action happens inside `dict` and `OrderedDict`, both provided by the stdlib.\r\n\r\nI wanted to know your opinions before I merged this in. If you have time, please take a look!","created_at":"2016-10-06T14:18:18Z","updated_at":"2016-10-06T23:01:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd2715cef897210a0b5951692e17802243494a75","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/slezica/python-frozendict/pulls/15/commits","review_comments_url":"https://api.github.com/repos/slezica/python-frozendict/pulls/15/comments","review_comment_url":"https://api.github.com/repos/slezica/python-frozendict/pulls/comments{/number}","comments_url":"https://api.github.com/repos/slezica/python-frozendict/issues/15/comments","statuses_url":"https://api.github.com/repos/slezica/python-frozendict/statuses/e38fc9213087038471c2f5128925a86b83f0848d","head":{"label":"slezica:tests","ref":"tests","sha":"e38fc9213087038471c2f5128925a86b83f0848d","user":{"login":"slezica","id":321596,"avatar_url":"https://avatars.githubusercontent.com/u/321596?v=3","gravatar_id":"","url":"https://api.github.com/users/slezica","html_url":"https://github.com/slezica","followers_url":"https://api.github.com/users/slezica/followers","following_url":"https://api.github.com/users/slezica/following{/other_user}","gists_url":"https://api.github.com/users/slezica/gists{/gist_id}","starred_url":"https://api.github.com/users/slezica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slezica/subscriptions","organizations_url":"https://api.github.com/users/slezica/orgs","repos_url":"https://api.github.com/users/slezica/repos","events_url":"https://api.github.com/users/slezica/events{/privacy}","received_events_url":"https://api.github.com/users/slezica/received_events","type":"User","site_admin":false},"repo":{"id":7117586,"name":"python-frozendict","full_name":"slezica/python-frozendict","owner":{"login":"slezica","id":321596,"avatar_url":"https://avatars.githubusercontent.com/u/321596?v=3","gravatar_id":"","url":"https://api.github.com/users/slezica","html_url":"https://github.com/slezica","followers_url":"https://api.github.com/users/slezica/followers","following_url":"https://api.github.com/users/slezica/following{/other_user}","gists_url":"https://api.github.com/users/slezica/gists{/gist_id}","starred_url":"https://api.github.com/users/slezica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slezica/subscriptions","organizations_url":"https://api.github.com/users/slezica/orgs","repos_url":"https://api.github.com/users/slezica/repos","events_url":"https://api.github.com/users/slezica/events{/privacy}","received_events_url":"https://api.github.com/users/slezica/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/slezica/python-frozendict","description":"A simple immutable mapping for python","fork":false,"url":"https://api.github.com/repos/slezica/python-frozendict","forks_url":"https://api.github.com/repos/slezica/python-frozendict/forks","keys_url":"https://api.github.com/repos/slezica/python-frozendict/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slezica/python-frozendict/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slezica/python-frozendict/teams","hooks_url":"https://api.github.com/repos/slezica/python-frozendict/hooks","issue_events_url":"https://api.github.com/repos/slezica/python-frozendict/issues/events{/number}","events_url":"https://api.github.com/repos/slezica/python-frozendict/events","assignees_url":"https://api.github.com/repos/slezica/python-frozendict/assignees{/user}","branches_url":"https://api.github.com/repos/slezica/python-frozendict/branches{/branch}","tags_url":"https://api.github.com/repos/slezica/python-frozendict/tags","blobs_url":"https://api.github.com/repos/slezica/python-frozendict/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slezica/python-frozendict/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slezica/python-frozendict/git/refs{/sha}","trees_url":"https://api.github.com/repos/slezica/python-frozendict/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slezica/python-frozendict/statuses/{sha}","languages_url":"https://api.github.com/repos/slezica/python-frozendict/languages","stargazers_url":"https://api.github.com/repos/slezica/python-frozendict/stargazers","contributors_url":"https://api.github.com/repos/slezica/python-frozendict/contributors","subscribers_url":"https://api.github.com/repos/slezica/python-frozendict/subscribers","subscription_url":"https://api.github.com/repos/slezica/python-frozendict/subscription","commits_url":"https://api.github.com/repos/slezica/python-frozendict/commits{/sha}","git_commits_url":"https://api.github.com/repos/slezica/python-frozendict/git/commits{/sha}","comments_url":"https://api.github.com/repos/slezica/python-frozendict/comments{/number}","issue_comment_url":"https://api.github.com/repos/slezica/python-frozendict/issues/comments{/number}","contents_url":"https://api.github.com/repos/slezica/python-frozendict/contents/{+path}","compare_url":"https://api.github.com/repos/slezica/python-frozendict/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slezica/python-frozendict/merges","archive_url":"https://api.github.com/repos/slezica/python-frozendict/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slezica/python-frozendict/downloads","issues_url":"https://api.github.com/repos/slezica/python-frozendict/issues{/number}","pulls_url":"https://api.github.com/repos/slezica/python-frozendict/pulls{/number}","milestones_url":"https://api.github.com/repos/slezica/python-frozendict/milestones{/number}","notifications_url":"https://api.github.com/repos/slezica/python-frozendict/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slezica/python-frozendict/labels{/name}","releases_url":"https://api.github.com/repos/slezica/python-frozendict/releases{/id}","deployments_url":"https://api.github.com/repos/slezica/python-frozendict/deployments","created_at":"2012-12-11T19:04:17Z","updated_at":"2016-10-02T18:25:23Z","pushed_at":"2016-10-06T14:18:18Z","git_url":"git://github.com/slezica/python-frozendict.git","ssh_url":"git@github.com:slezica/python-frozendict.git","clone_url":"https://github.com/slezica/python-frozendict.git","svn_url":"https://github.com/slezica/python-frozendict","homepage":null,"size":23,"stargazers_count":34,"watchers_count":34,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":3,"forks":10,"open_issues":3,"watchers":34,"default_branch":"master"}},"base":{"label":"slezica:master","ref":"master","sha":"c5d16bafcca7b72ff3e8f40d3a9081e4c9233f1b","user":{"login":"slezica","id":321596,"avatar_url":"https://avatars.githubusercontent.com/u/321596?v=3","gravatar_id":"","url":"https://api.github.com/users/slezica","html_url":"https://github.com/slezica","followers_url":"https://api.github.com/users/slezica/followers","following_url":"https://api.github.com/users/slezica/following{/other_user}","gists_url":"https://api.github.com/users/slezica/gists{/gist_id}","starred_url":"https://api.github.com/users/slezica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slezica/subscriptions","organizations_url":"https://api.github.com/users/slezica/orgs","repos_url":"https://api.github.com/users/slezica/repos","events_url":"https://api.github.com/users/slezica/events{/privacy}","received_events_url":"https://api.github.com/users/slezica/received_events","type":"User","site_admin":false},"repo":{"id":7117586,"name":"python-frozendict","full_name":"slezica/python-frozendict","owner":{"login":"slezica","id":321596,"avatar_url":"https://avatars.githubusercontent.com/u/321596?v=3","gravatar_id":"","url":"https://api.github.com/users/slezica","html_url":"https://github.com/slezica","followers_url":"https://api.github.com/users/slezica/followers","following_url":"https://api.github.com/users/slezica/following{/other_user}","gists_url":"https://api.github.com/users/slezica/gists{/gist_id}","starred_url":"https://api.github.com/users/slezica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slezica/subscriptions","organizations_url":"https://api.github.com/users/slezica/orgs","repos_url":"https://api.github.com/users/slezica/repos","events_url":"https://api.github.com/users/slezica/events{/privacy}","received_events_url":"https://api.github.com/users/slezica/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/slezica/python-frozendict","description":"A simple immutable mapping for python","fork":false,"url":"https://api.github.com/repos/slezica/python-frozendict","forks_url":"https://api.github.com/repos/slezica/python-frozendict/forks","keys_url":"https://api.github.com/repos/slezica/python-frozendict/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slezica/python-frozendict/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slezica/python-frozendict/teams","hooks_url":"https://api.github.com/repos/slezica/python-frozendict/hooks","issue_events_url":"https://api.github.com/repos/slezica/python-frozendict/issues/events{/number}","events_url":"https://api.github.com/repos/slezica/python-frozendict/events","assignees_url":"https://api.github.com/repos/slezica/python-frozendict/assignees{/user}","branches_url":"https://api.github.com/repos/slezica/python-frozendict/branches{/branch}","tags_url":"https://api.github.com/repos/slezica/python-frozendict/tags","blobs_url":"https://api.github.com/repos/slezica/python-frozendict/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slezica/python-frozendict/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slezica/python-frozendict/git/refs{/sha}","trees_url":"https://api.github.com/repos/slezica/python-frozendict/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slezica/python-frozendict/statuses/{sha}","languages_url":"https://api.github.com/repos/slezica/python-frozendict/languages","stargazers_url":"https://api.github.com/repos/slezica/python-frozendict/stargazers","contributors_url":"https://api.github.com/repos/slezica/python-frozendict/contributors","subscribers_url":"https://api.github.com/repos/slezica/python-frozendict/subscribers","subscription_url":"https://api.github.com/repos/slezica/python-frozendict/subscription","commits_url":"https://api.github.com/repos/slezica/python-frozendict/commits{/sha}","git_commits_url":"https://api.github.com/repos/slezica/python-frozendict/git/commits{/sha}","comments_url":"https://api.github.com/repos/slezica/python-frozendict/comments{/number}","issue_comment_url":"https://api.github.com/repos/slezica/python-frozendict/issues/comments{/number}","contents_url":"https://api.github.com/repos/slezica/python-frozendict/contents/{+path}","compare_url":"https://api.github.com/repos/slezica/python-frozendict/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slezica/python-frozendict/merges","archive_url":"https://api.github.com/repos/slezica/python-frozendict/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slezica/python-frozendict/downloads","issues_url":"https://api.github.com/repos/slezica/python-frozendict/issues{/number}","pulls_url":"https://api.github.com/repos/slezica/python-frozendict/pulls{/number}","milestones_url":"https://api.github.com/repos/slezica/python-frozendict/milestones{/number}","notifications_url":"https://api.github.com/repos/slezica/python-frozendict/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slezica/python-frozendict/labels{/name}","releases_url":"https://api.github.com/repos/slezica/python-frozendict/releases{/id}","deployments_url":"https://api.github.com/repos/slezica/python-frozendict/deployments","created_at":"2012-12-11T19:04:17Z","updated_at":"2016-10-02T18:25:23Z","pushed_at":"2016-10-06T14:18:18Z","git_url":"git://github.com/slezica/python-frozendict.git","ssh_url":"git@github.com:slezica/python-frozendict.git","clone_url":"https://github.com/slezica/python-frozendict.git","svn_url":"https://github.com/slezica/python-frozendict","homepage":null,"size":23,"stargazers_count":34,"watchers_count":34,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":3,"forks":10,"open_issues":3,"watchers":34,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/slezica/python-frozendict/pulls/15"},"html":{"href":"https://github.com/slezica/python-frozendict/pull/15"},"issue":{"href":"https://api.github.com/repos/slezica/python-frozendict/issues/15"},"comments":{"href":"https://api.github.com/repos/slezica/python-frozendict/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/slezica/python-frozendict/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/slezica/python-frozendict/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/slezica/python-frozendict/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/slezica/python-frozendict/statuses/e38fc9213087038471c2f5128925a86b83f0848d"}}}}
{"actor":{"display_login":"ppolewicz"}}