{"action":"created","comment":{"url":"https://api.github.com/repos/pedrobaeza/openupgradelib/pulls/comments/37622395","id":37622395,"diff_hunk":"@@ -31,16 +38,213 @@ def import_mock(name, *args):\n     from openupgradelib import openupgrade\n \n \n+class PsycopgCrMock():\n+    def __init__(self):\n+        connection = sqlite3.connect(\":memory:\")\n+        self.sqlite_cr = connection.cursor()\n+        self.close = self.sqlite_cr.close\n+\n+    def execute(self, query, *a, **kw):\n+        return self.sqlite_cr.execute(\n+            RE_PSQL_FORMAT.sub(r'\\1?', query), *a, **kw\n+        )\n+\n+    @property\n+    def rowcount(self):\n+        return self.sqlite_cr.rowcount\n+\n+\n class TestOpenupgradelib(unittest.TestCase):\n \n     def setUp(self):\n-        pass\n+        self.cr = PsycopgCrMock()","path":"tests/test_openupgradelib.py","position":52,"original_position":52,"commit_id":"26ea23cffc79eaf52a3f53c6a01511dd553c6074","original_commit_id":"26ea23cffc79eaf52a3f53c6a01511dd553c6074","user":{"login":"dufresnedavid","id":8628981,"avatar_url":"https://avatars.githubusercontent.com/u/8628981?v=3","gravatar_id":"","url":"https://api.github.com/users/dufresnedavid","html_url":"https://github.com/dufresnedavid","followers_url":"https://api.github.com/users/dufresnedavid/followers","following_url":"https://api.github.com/users/dufresnedavid/following{/other_user}","gists_url":"https://api.github.com/users/dufresnedavid/gists{/gist_id}","starred_url":"https://api.github.com/users/dufresnedavid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dufresnedavid/subscriptions","organizations_url":"https://api.github.com/users/dufresnedavid/orgs","repos_url":"https://api.github.com/users/dufresnedavid/repos","events_url":"https://api.github.com/users/dufresnedavid/events{/privacy}","received_events_url":"https://api.github.com/users/dufresnedavid/received_events","type":"User","site_admin":false},"body":"This one will always be required","created_at":"2015-08-21T10:20:01Z","updated_at":"2015-08-21T10:20:01Z","html_url":"https://github.com/pedrobaeza/openupgradelib/pull/1#discussion_r37622395","pull_request_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/pedrobaeza/openupgradelib/pulls/comments/37622395"},"html":{"href":"https://github.com/pedrobaeza/openupgradelib/pull/1#discussion_r37622395"},"pull_request":{"href":"https://api.github.com/repos/pedrobaeza/openupgradelib/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/pedrobaeza/openupgradelib/pulls/1","id":42747595,"html_url":"https://github.com/pedrobaeza/openupgradelib/pull/1","diff_url":"https://github.com/pedrobaeza/openupgradelib/pull/1.diff","patch_url":"https://github.com/pedrobaeza/openupgradelib/pull/1.patch","issue_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/issues/1","number":1,"state":"open","locked":false,"title":"Add tests to `update_module_names`","user":{"login":"bwrsandman","id":1013356,"avatar_url":"https://avatars.githubusercontent.com/u/1013356?v=3","gravatar_id":"","url":"https://api.github.com/users/bwrsandman","html_url":"https://github.com/bwrsandman","followers_url":"https://api.github.com/users/bwrsandman/followers","following_url":"https://api.github.com/users/bwrsandman/following{/other_user}","gists_url":"https://api.github.com/users/bwrsandman/gists{/gist_id}","starred_url":"https://api.github.com/users/bwrsandman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwrsandman/subscriptions","organizations_url":"https://api.github.com/users/bwrsandman/orgs","repos_url":"https://api.github.com/users/bwrsandman/repos","events_url":"https://api.github.com/users/bwrsandman/events{/privacy}","received_events_url":"https://api.github.com/users/bwrsandman/received_events","type":"User","site_admin":false},"body":"sqlite3 was used because it is in the python standard library and openupgradelib doesn't need to have any extra dependencies to run tests. It has the added benefit of being able to create a database in RAM instead of the disk like pg does.\r\n\r\nA mock class for the sqlite cursor was added to convert postgresql particularities to sqlite. This can be expanded as more complex test cases are added.\r\n\r\nHopefully, with this, more tests will be added and the lib can evolve nicely into a very versatile tool.","created_at":"2015-08-18T20:55:34Z","updated_at":"2015-08-21T10:20:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a11d99bb3755ae5f36422443ba90d2b3852aced","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/pulls/1/commits","review_comments_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/pulls/1/comments","review_comment_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/issues/1/comments","statuses_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/statuses/26ea23cffc79eaf52a3f53c6a01511dd553c6074","head":{"label":"bwrsandman:update_module_name-handle-ir_translation","ref":"update_module_name-handle-ir_translation","sha":"26ea23cffc79eaf52a3f53c6a01511dd553c6074","user":{"login":"bwrsandman","id":1013356,"avatar_url":"https://avatars.githubusercontent.com/u/1013356?v=3","gravatar_id":"","url":"https://api.github.com/users/bwrsandman","html_url":"https://github.com/bwrsandman","followers_url":"https://api.github.com/users/bwrsandman/followers","following_url":"https://api.github.com/users/bwrsandman/following{/other_user}","gists_url":"https://api.github.com/users/bwrsandman/gists{/gist_id}","starred_url":"https://api.github.com/users/bwrsandman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwrsandman/subscriptions","organizations_url":"https://api.github.com/users/bwrsandman/orgs","repos_url":"https://api.github.com/users/bwrsandman/repos","events_url":"https://api.github.com/users/bwrsandman/events{/privacy}","received_events_url":"https://api.github.com/users/bwrsandman/received_events","type":"User","site_admin":false},"repo":{"id":40631039,"name":"openupgradelib","full_name":"bwrsandman/openupgradelib","owner":{"login":"bwrsandman","id":1013356,"avatar_url":"https://avatars.githubusercontent.com/u/1013356?v=3","gravatar_id":"","url":"https://api.github.com/users/bwrsandman","html_url":"https://github.com/bwrsandman","followers_url":"https://api.github.com/users/bwrsandman/followers","following_url":"https://api.github.com/users/bwrsandman/following{/other_user}","gists_url":"https://api.github.com/users/bwrsandman/gists{/gist_id}","starred_url":"https://api.github.com/users/bwrsandman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwrsandman/subscriptions","organizations_url":"https://api.github.com/users/bwrsandman/orgs","repos_url":"https://api.github.com/users/bwrsandman/repos","events_url":"https://api.github.com/users/bwrsandman/events{/privacy}","received_events_url":"https://api.github.com/users/bwrsandman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bwrsandman/openupgradelib","description":"A library with support functions to be called from Odoo migration scripts.","fork":true,"url":"https://api.github.com/repos/bwrsandman/openupgradelib","forks_url":"https://api.github.com/repos/bwrsandman/openupgradelib/forks","keys_url":"https://api.github.com/repos/bwrsandman/openupgradelib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bwrsandman/openupgradelib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bwrsandman/openupgradelib/teams","hooks_url":"https://api.github.com/repos/bwrsandman/openupgradelib/hooks","issue_events_url":"https://api.github.com/repos/bwrsandman/openupgradelib/issues/events{/number}","events_url":"https://api.github.com/repos/bwrsandman/openupgradelib/events","assignees_url":"https://api.github.com/repos/bwrsandman/openupgradelib/assignees{/user}","branches_url":"https://api.github.com/repos/bwrsandman/openupgradelib/branches{/branch}","tags_url":"https://api.github.com/repos/bwrsandman/openupgradelib/tags","blobs_url":"https://api.github.com/repos/bwrsandman/openupgradelib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bwrsandman/openupgradelib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bwrsandman/openupgradelib/git/refs{/sha}","trees_url":"https://api.github.com/repos/bwrsandman/openupgradelib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bwrsandman/openupgradelib/statuses/{sha}","languages_url":"https://api.github.com/repos/bwrsandman/openupgradelib/languages","stargazers_url":"https://api.github.com/repos/bwrsandman/openupgradelib/stargazers","contributors_url":"https://api.github.com/repos/bwrsandman/openupgradelib/contributors","subscribers_url":"https://api.github.com/repos/bwrsandman/openupgradelib/subscribers","subscription_url":"https://api.github.com/repos/bwrsandman/openupgradelib/subscription","commits_url":"https://api.github.com/repos/bwrsandman/openupgradelib/commits{/sha}","git_commits_url":"https://api.github.com/repos/bwrsandman/openupgradelib/git/commits{/sha}","comments_url":"https://api.github.com/repos/bwrsandman/openupgradelib/comments{/number}","issue_comment_url":"https://api.github.com/repos/bwrsandman/openupgradelib/issues/comments{/number}","contents_url":"https://api.github.com/repos/bwrsandman/openupgradelib/contents/{+path}","compare_url":"https://api.github.com/repos/bwrsandman/openupgradelib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bwrsandman/openupgradelib/merges","archive_url":"https://api.github.com/repos/bwrsandman/openupgradelib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bwrsandman/openupgradelib/downloads","issues_url":"https://api.github.com/repos/bwrsandman/openupgradelib/issues{/number}","pulls_url":"https://api.github.com/repos/bwrsandman/openupgradelib/pulls{/number}","milestones_url":"https://api.github.com/repos/bwrsandman/openupgradelib/milestones{/number}","notifications_url":"https://api.github.com/repos/bwrsandman/openupgradelib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bwrsandman/openupgradelib/labels{/name}","releases_url":"https://api.github.com/repos/bwrsandman/openupgradelib/releases{/id}","created_at":"2015-08-13T00:34:18Z","updated_at":"2015-08-13T00:34:18Z","pushed_at":"2015-08-18T20:48:08Z","git_url":"git://github.com/bwrsandman/openupgradelib.git","ssh_url":"git@github.com:bwrsandman/openupgradelib.git","clone_url":"https://github.com/bwrsandman/openupgradelib.git","svn_url":"https://github.com/bwrsandman/openupgradelib","homepage":"","size":254,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"pedrobaeza:update_module_name-handle-ir_translation","ref":"update_module_name-handle-ir_translation","sha":"77c2225f478b191fccf2332df0f71a9a891ffa47","user":{"login":"pedrobaeza","id":7165771,"avatar_url":"https://avatars.githubusercontent.com/u/7165771?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrobaeza","html_url":"https://github.com/pedrobaeza","followers_url":"https://api.github.com/users/pedrobaeza/followers","following_url":"https://api.github.com/users/pedrobaeza/following{/other_user}","gists_url":"https://api.github.com/users/pedrobaeza/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrobaeza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrobaeza/subscriptions","organizations_url":"https://api.github.com/users/pedrobaeza/orgs","repos_url":"https://api.github.com/users/pedrobaeza/repos","events_url":"https://api.github.com/users/pedrobaeza/events{/privacy}","received_events_url":"https://api.github.com/users/pedrobaeza/received_events","type":"User","site_admin":false},"repo":{"id":40553074,"name":"openupgradelib","full_name":"pedrobaeza/openupgradelib","owner":{"login":"pedrobaeza","id":7165771,"avatar_url":"https://avatars.githubusercontent.com/u/7165771?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrobaeza","html_url":"https://github.com/pedrobaeza","followers_url":"https://api.github.com/users/pedrobaeza/followers","following_url":"https://api.github.com/users/pedrobaeza/following{/other_user}","gists_url":"https://api.github.com/users/pedrobaeza/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrobaeza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrobaeza/subscriptions","organizations_url":"https://api.github.com/users/pedrobaeza/orgs","repos_url":"https://api.github.com/users/pedrobaeza/repos","events_url":"https://api.github.com/users/pedrobaeza/events{/privacy}","received_events_url":"https://api.github.com/users/pedrobaeza/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pedrobaeza/openupgradelib","description":"A library with support functions to be called from Odoo migration scripts.","fork":true,"url":"https://api.github.com/repos/pedrobaeza/openupgradelib","forks_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/forks","keys_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/teams","hooks_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/hooks","issue_events_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/issues/events{/number}","events_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/events","assignees_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/assignees{/user}","branches_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/branches{/branch}","tags_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/tags","blobs_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/git/refs{/sha}","trees_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/statuses/{sha}","languages_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/languages","stargazers_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/stargazers","contributors_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/contributors","subscribers_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/subscribers","subscription_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/subscription","commits_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/commits{/sha}","git_commits_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/git/commits{/sha}","comments_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/comments{/number}","issue_comment_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/issues/comments{/number}","contents_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/contents/{+path}","compare_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/merges","archive_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/downloads","issues_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/issues{/number}","pulls_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/pulls{/number}","milestones_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/milestones{/number}","notifications_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/labels{/name}","releases_url":"https://api.github.com/repos/pedrobaeza/openupgradelib/releases{/id}","created_at":"2015-08-11T16:35:39Z","updated_at":"2015-08-11T16:35:40Z","pushed_at":"2015-08-18T20:55:34Z","git_url":"git://github.com/pedrobaeza/openupgradelib.git","ssh_url":"git@github.com:pedrobaeza/openupgradelib.git","clone_url":"https://github.com/pedrobaeza/openupgradelib.git","svn_url":"https://github.com/pedrobaeza/openupgradelib","homepage":"","size":275,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"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/pedrobaeza/openupgradelib/pulls/1"},"html":{"href":"https://github.com/pedrobaeza/openupgradelib/pull/1"},"issue":{"href":"https://api.github.com/repos/pedrobaeza/openupgradelib/issues/1"},"comments":{"href":"https://api.github.com/repos/pedrobaeza/openupgradelib/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/pedrobaeza/openupgradelib/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/pedrobaeza/openupgradelib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pedrobaeza/openupgradelib/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/pedrobaeza/openupgradelib/statuses/26ea23cffc79eaf52a3f53c6a01511dd553c6074"}}}}