{"action":"created","comment":{"url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/pulls/comments/37743790","id":37743790,"diff_hunk":"@@ -156,17 +181,38 @@ def _test_default_resolver(self, import_url, rules,\n \n         urls_to_resolve = []\n \n-        def mock_urlopen(url):\n-            urls_to_resolve.append(url)\n-            if url in [ORIGINAL_V1_URL, ORIGINAL_V2_URL, INVALID_V1_URL]:\n-                raise urllib2.URLError('invalid url: {0}'.format(url))\n-            elif url == ILLEGAL_URL:\n-                raise ValueError('unknown url type: {0}'.format(url))\n-            elif url in [VALID_V1_URL, VALID_V2_URL]:\n-                return mock.MagicMock()\n-\n-        resolver = DefaultImportResolver(rules)\n-        with mock.patch('urllib2.urlopen', new=mock_urlopen):\n+        class mock_requests_get():\n+\n+            def __init__(self, url, timeout):\n+                self.status_code = 200\n+                self.text = 200\n+                if url not in urls_to_resolve:\n+                    urls_to_resolve.append(url)\n+                if url in [ORIGINAL_V1_URL, ORIGINAL_V2_URL, INVALID_V1_URL]:\n+                    raise requests.URLRequired(\n+                        'invalid url: {0}'.format(url))\n+                elif url == ILLEGAL_URL:\n+                    raise requests.URLRequired(\n+                        'unknown url type: {0}'.format(\n+                            url))\n+                elif url in [VALID_V1_URL, VALID_V2_URL]:\n+                    return None\n+                elif url == TIMEOUT_URL:\n+                    time.sleep(DEFAULT_NUMBER_RETRIES*(","path":"dsl_parser/tests/test_deafult_import_resolver.py","position":101,"original_position":101,"commit_id":"cfb596fe9a3249fd94e9bfacdfaaf2fe5645b57b","original_commit_id":"cfb596fe9a3249fd94e9bfacdfaaf2fe5645b57b","user":{"login":"dankilman","id":1008577,"avatar_url":"https://avatars.githubusercontent.com/u/1008577?v=3","gravatar_id":"","url":"https://api.github.com/users/dankilman","html_url":"https://github.com/dankilman","followers_url":"https://api.github.com/users/dankilman/followers","following_url":"https://api.github.com/users/dankilman/following{/other_user}","gists_url":"https://api.github.com/users/dankilman/gists{/gist_id}","starred_url":"https://api.github.com/users/dankilman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dankilman/subscriptions","organizations_url":"https://api.github.com/users/dankilman/orgs","repos_url":"https://api.github.com/users/dankilman/repos","events_url":"https://api.github.com/users/dankilman/events{/privacy}","received_events_url":"https://api.github.com/users/dankilman/received_events","type":"User","site_admin":false},"body":"remove sleep","created_at":"2015-08-24T12:05:48Z","updated_at":"2015-08-24T12:05:48Z","html_url":"https://github.com/cloudify-cosmo/cloudify-dsl-parser/pull/55#discussion_r37743790","pull_request_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/pulls/55","_links":{"self":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/pulls/comments/37743790"},"html":{"href":"https://github.com/cloudify-cosmo/cloudify-dsl-parser/pull/55#discussion_r37743790"},"pull_request":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/pulls/55"}}},"pull_request":{"url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/pulls/55","id":42025127,"html_url":"https://github.com/cloudify-cosmo/cloudify-dsl-parser/pull/55","diff_url":"https://github.com/cloudify-cosmo/cloudify-dsl-parser/pull/55.diff","patch_url":"https://github.com/cloudify-cosmo/cloudify-dsl-parser/pull/55.patch","issue_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/issues/55","number":55,"state":"open","locked":false,"title":"CFY-2848-DSL-Parser-should-retry-imports-loading-in-case-of-network-c…","user":{"login":"gilzellner","id":6705750,"avatar_url":"https://avatars.githubusercontent.com/u/6705750?v=3","gravatar_id":"","url":"https://api.github.com/users/gilzellner","html_url":"https://github.com/gilzellner","followers_url":"https://api.github.com/users/gilzellner/followers","following_url":"https://api.github.com/users/gilzellner/following{/other_user}","gists_url":"https://api.github.com/users/gilzellner/gists{/gist_id}","starred_url":"https://api.github.com/users/gilzellner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gilzellner/subscriptions","organizations_url":"https://api.github.com/users/gilzellner/orgs","repos_url":"https://api.github.com/users/gilzellner/repos","events_url":"https://api.github.com/users/gilzellner/events{/privacy}","received_events_url":"https://api.github.com/users/gilzellner/received_events","type":"User","site_admin":false},"body":"CFY-2848-DSL-Parser-should-retry-imports-loading-in-case-of-network-connectivity-issues","created_at":"2015-08-10T14:23:00Z","updated_at":"2015-08-24T12:05:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de39a14c0b1d14d234b44104d4d45f14e595e59b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/pulls/55/commits","review_comments_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/pulls/55/comments","review_comment_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/issues/55/comments","statuses_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/statuses/cfb596fe9a3249fd94e9bfacdfaaf2fe5645b57b","head":{"label":"cloudify-cosmo:CFY-2848-DSL-Parser-should-retry-imports-loading-in-case-of-network-connectivity-issues","ref":"CFY-2848-DSL-Parser-should-retry-imports-loading-in-case-of-network-connectivity-issues","sha":"cfb596fe9a3249fd94e9bfacdfaaf2fe5645b57b","user":{"login":"cloudify-cosmo","id":6260555,"avatar_url":"https://avatars.githubusercontent.com/u/6260555?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudify-cosmo","html_url":"https://github.com/cloudify-cosmo","followers_url":"https://api.github.com/users/cloudify-cosmo/followers","following_url":"https://api.github.com/users/cloudify-cosmo/following{/other_user}","gists_url":"https://api.github.com/users/cloudify-cosmo/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudify-cosmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudify-cosmo/subscriptions","organizations_url":"https://api.github.com/users/cloudify-cosmo/orgs","repos_url":"https://api.github.com/users/cloudify-cosmo/repos","events_url":"https://api.github.com/users/cloudify-cosmo/events{/privacy}","received_events_url":"https://api.github.com/users/cloudify-cosmo/received_events","type":"Organization","site_admin":false},"repo":{"id":18327612,"name":"cloudify-dsl-parser","full_name":"cloudify-cosmo/cloudify-dsl-parser","owner":{"login":"cloudify-cosmo","id":6260555,"avatar_url":"https://avatars.githubusercontent.com/u/6260555?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudify-cosmo","html_url":"https://github.com/cloudify-cosmo","followers_url":"https://api.github.com/users/cloudify-cosmo/followers","following_url":"https://api.github.com/users/cloudify-cosmo/following{/other_user}","gists_url":"https://api.github.com/users/cloudify-cosmo/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudify-cosmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudify-cosmo/subscriptions","organizations_url":"https://api.github.com/users/cloudify-cosmo/orgs","repos_url":"https://api.github.com/users/cloudify-cosmo/repos","events_url":"https://api.github.com/users/cloudify-cosmo/events{/privacy}","received_events_url":"https://api.github.com/users/cloudify-cosmo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudify-cosmo/cloudify-dsl-parser","description":"Cloudify DSL Parser","fork":false,"url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser","forks_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/forks","keys_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/teams","hooks_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/hooks","issue_events_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/issues/events{/number}","events_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/events","assignees_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/assignees{/user}","branches_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/branches{/branch}","tags_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/tags","blobs_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/languages","stargazers_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/stargazers","contributors_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/contributors","subscribers_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/subscribers","subscription_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/subscription","commits_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/contents/{+path}","compare_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/merges","archive_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/downloads","issues_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/issues{/number}","pulls_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/labels{/name}","releases_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/releases{/id}","created_at":"2014-04-01T11:47:37Z","updated_at":"2015-08-06T07:26:09Z","pushed_at":"2015-08-24T11:04:47Z","git_url":"git://github.com/cloudify-cosmo/cloudify-dsl-parser.git","ssh_url":"git@github.com:cloudify-cosmo/cloudify-dsl-parser.git","clone_url":"https://github.com/cloudify-cosmo/cloudify-dsl-parser.git","svn_url":"https://github.com/cloudify-cosmo/cloudify-dsl-parser","homepage":null,"size":6190,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":3,"forks":7,"open_issues":3,"watchers":2,"default_branch":"master"}},"base":{"label":"cloudify-cosmo:master","ref":"master","sha":"eb66dbd3cc94e6cef5ca2ea1b7ab2aabcf1b2649","user":{"login":"cloudify-cosmo","id":6260555,"avatar_url":"https://avatars.githubusercontent.com/u/6260555?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudify-cosmo","html_url":"https://github.com/cloudify-cosmo","followers_url":"https://api.github.com/users/cloudify-cosmo/followers","following_url":"https://api.github.com/users/cloudify-cosmo/following{/other_user}","gists_url":"https://api.github.com/users/cloudify-cosmo/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudify-cosmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudify-cosmo/subscriptions","organizations_url":"https://api.github.com/users/cloudify-cosmo/orgs","repos_url":"https://api.github.com/users/cloudify-cosmo/repos","events_url":"https://api.github.com/users/cloudify-cosmo/events{/privacy}","received_events_url":"https://api.github.com/users/cloudify-cosmo/received_events","type":"Organization","site_admin":false},"repo":{"id":18327612,"name":"cloudify-dsl-parser","full_name":"cloudify-cosmo/cloudify-dsl-parser","owner":{"login":"cloudify-cosmo","id":6260555,"avatar_url":"https://avatars.githubusercontent.com/u/6260555?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudify-cosmo","html_url":"https://github.com/cloudify-cosmo","followers_url":"https://api.github.com/users/cloudify-cosmo/followers","following_url":"https://api.github.com/users/cloudify-cosmo/following{/other_user}","gists_url":"https://api.github.com/users/cloudify-cosmo/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudify-cosmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudify-cosmo/subscriptions","organizations_url":"https://api.github.com/users/cloudify-cosmo/orgs","repos_url":"https://api.github.com/users/cloudify-cosmo/repos","events_url":"https://api.github.com/users/cloudify-cosmo/events{/privacy}","received_events_url":"https://api.github.com/users/cloudify-cosmo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudify-cosmo/cloudify-dsl-parser","description":"Cloudify DSL Parser","fork":false,"url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser","forks_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/forks","keys_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/teams","hooks_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/hooks","issue_events_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/issues/events{/number}","events_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/events","assignees_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/assignees{/user}","branches_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/branches{/branch}","tags_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/tags","blobs_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/languages","stargazers_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/stargazers","contributors_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/contributors","subscribers_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/subscribers","subscription_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/subscription","commits_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/contents/{+path}","compare_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/merges","archive_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/downloads","issues_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/issues{/number}","pulls_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/labels{/name}","releases_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/releases{/id}","created_at":"2014-04-01T11:47:37Z","updated_at":"2015-08-06T07:26:09Z","pushed_at":"2015-08-24T11:04:47Z","git_url":"git://github.com/cloudify-cosmo/cloudify-dsl-parser.git","ssh_url":"git@github.com:cloudify-cosmo/cloudify-dsl-parser.git","clone_url":"https://github.com/cloudify-cosmo/cloudify-dsl-parser.git","svn_url":"https://github.com/cloudify-cosmo/cloudify-dsl-parser","homepage":null,"size":6190,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":3,"forks":7,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/pulls/55"},"html":{"href":"https://github.com/cloudify-cosmo/cloudify-dsl-parser/pull/55"},"issue":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/issues/55"},"comments":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/issues/55/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/pulls/55/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/pulls/55/commits"},"statuses":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-dsl-parser/statuses/cfb596fe9a3249fd94e9bfacdfaaf2fe5645b57b"}}}}