{"action":"created","comment":{"url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/pulls/comments/53328194","id":53328194,"diff_hunk":"@@ -0,0 +1,144 @@\n+import os\n+import tempfile\n+\n+import pytest\n+from django.conf import settings\n+\n+import osmaxx.conversion.formats\n+\n+format_list = osmaxx.conversion.formats.FORMAT_DEFINITIONS.keys()\n+\n+\n+@pytest.fixture(params=format_list)\n+def conversion_format(request):\n+    return request.param\n+\n+\n+@pytest.fixture\n+def area_name():\n+    return 'area_name'\n+\n+\n+@pytest.fixture()\n+def output_zip_file_path():\n+    return '/some/test/path/to/a/zipfile.zip'\n+\n+\n+@pytest.fixture()\n+def filename_prefix():\n+    return 'test_prefix_for_this_example'\n+\n+\n+@pytest.fixture()\n+def out_srs():\n+    return 'EPSG:4326'\n+\n+\n+@pytest.fixture\n+def simple_osmosis_line_string():\n+    return os.linesep.join([\n+        'none',\n+        '1-outer',\n+        '  0.000000E+00 0.000000E+00',\n+        '  0.000000E+00 1.000000E+00',\n+        '  1.000000E+00 1.000000E+00',\n+        '  0.000000E+00 0.000000E+00',\n+        'END',\n+        '2-outer',\n+        '  1.000000E+00 1.000000E+00',\n+        '  1.000000E+00 2.000000E+00',\n+        '  2.000000E+00 2.000000E+00',\n+        '  1.000000E+00 1.000000E+00',\n+        'END',\n+        'END',\n+        '',\n+    ])\n+\n+\n+@pytest.fixture(params=format_list)\n+def conversion_parametrization_data(request, valid_clipping_area):\n+    out_format = request.param\n+    # TODO: parametrize the srs to test with different srses as well.\n+    out_srs = 4326\n+    clipping_area = valid_clipping_area.id\n+    return {'out_format': out_format, 'out_srs': out_srs, 'clipping_area': clipping_area}\n+\n+\n+@pytest.fixture(params=format_list)\n+def conversion_parametrization(request, valid_clipping_area):\n+    out_format = request.param\n+    # TODO: parametrize the srs to test with different srses as well.\n+    out_srs = 4326\n+    from osmaxx.conversion.models import Parametrization\n+    return Parametrization.objects.create(out_format=out_format, out_srs=out_srs, clipping_area=valid_clipping_area)\n+\n+\n+@pytest.fixture\n+def server_url():\n+    return 'http://backends.own.url.example.com'\n+\n+\n+@pytest.fixture\n+def fake_rq_id():\n+    return 42\n+\n+\n+@pytest.fixture\n+def empty_zip(request):\n+    zip_file = tempfile.NamedTemporaryFile(suffix='.zip')\n+\n+    def remove_tmp_file():\n+        try:\n+            zip_file.close()\n+        except FileNotFoundError:  # already removed by some test\n+            pass\n+    request.addfinalizer(remove_tmp_file)\n+    return zip_file\n+\n+\n+@pytest.fixture\n+def conversion_job_data(conversion_parametrization):\n+    conversion_parametrization = conversion_parametrization.id\n+    return {'callback_url': 'http://callback.example.com', 'parametrization': conversion_parametrization}\n+\n+\n+@pytest.fixture\n+def conversion_job(conversion_parametrization, server_url):\n+    from osmaxx.conversion.models import Job\n+    return Job.objects.create(own_base_url=server_url, parametrization=conversion_parametrization)\n+\n+\n+@pytest.fixture\n+def conversion_job_started(conversion_parametrization, server_url, fake_rq_id):\n+    from osmaxx.conversion.models import Job\n+    return Job.objects.create(own_base_url=server_url, parametrization=conversion_parametrization, rq_job_id=fake_rq_id, status=Job.STARTED)\n+\n+\n+@pytest.fixture\n+def conversion_job_failed(conversion_parametrization, server_url, fake_rq_id):","path":"tests/conversion/conftest.py","position":118,"original_position":118,"commit_id":"793c9658ab655726f8898fe6cdd1875c59437235","original_commit_id":"793c9658ab655726f8898fe6cdd1875c59437235","user":{"login":"das-g","id":97746,"avatar_url":"https://avatars.githubusercontent.com/u/97746?v=3","gravatar_id":"","url":"https://api.github.com/users/das-g","html_url":"https://github.com/das-g","followers_url":"https://api.github.com/users/das-g/followers","following_url":"https://api.github.com/users/das-g/following{/other_user}","gists_url":"https://api.github.com/users/das-g/gists{/gist_id}","starred_url":"https://api.github.com/users/das-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/das-g/subscriptions","organizations_url":"https://api.github.com/users/das-g/orgs","repos_url":"https://api.github.com/users/das-g/repos","events_url":"https://api.github.com/users/das-g/events{/privacy}","received_events_url":"https://api.github.com/users/das-g/received_events","type":"User","site_admin":false},"body":"how about naming this `failed_conversion_job`?","created_at":"2016-02-18T15:24:48Z","updated_at":"2016-02-18T15:24:48Z","html_url":"https://github.com/geometalab/osmaxx-conversion-service/pull/119#discussion_r53328194","pull_request_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/pulls/119","_links":{"self":{"href":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/pulls/comments/53328194"},"html":{"href":"https://github.com/geometalab/osmaxx-conversion-service/pull/119#discussion_r53328194"},"pull_request":{"href":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/pulls/119"}}},"pull_request":{"url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/pulls/119","id":59790734,"html_url":"https://github.com/geometalab/osmaxx-conversion-service/pull/119","diff_url":"https://github.com/geometalab/osmaxx-conversion-service/pull/119.diff","patch_url":"https://github.com/geometalab/osmaxx-conversion-service/pull/119.patch","issue_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/issues/119","number":119,"state":"open","locked":false,"title":"Feature/#96 arbitrary polygon support","user":{"login":"hixi","id":97119,"avatar_url":"https://avatars.githubusercontent.com/u/97119?v=3","gravatar_id":"","url":"https://api.github.com/users/hixi","html_url":"https://github.com/hixi","followers_url":"https://api.github.com/users/hixi/followers","following_url":"https://api.github.com/users/hixi/following{/other_user}","gists_url":"https://api.github.com/users/hixi/gists{/gist_id}","starred_url":"https://api.github.com/users/hixi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hixi/subscriptions","organizations_url":"https://api.github.com/users/hixi/orgs","repos_url":"https://api.github.com/users/hixi/repos","events_url":"https://api.github.com/users/hixi/events{/privacy}","received_events_url":"https://api.github.com/users/hixi/received_events","type":"User","site_admin":false},"body":"- [ ] remove  dc0a3ec again\r\n\r\nImplements the conversion-service side of this feature. Also features a partial rewrite, maybe use the test commits to review especially commit 472c017.\r\n\r\nReviewed by:\r\n- [ ] @das-g \r\n\r\n\r\n","created_at":"2016-02-18T12:18:58Z","updated_at":"2016-02-18T15:24:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"887b749179bdbab33640efacc744aec15f0e4584","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/pulls/119/commits","review_comments_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/pulls/119/comments","review_comment_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/issues/119/comments","statuses_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/statuses/793c9658ab655726f8898fe6cdd1875c59437235","head":{"label":"geometalab:feature/#96_arbitrary_polygon_support","ref":"feature/#96_arbitrary_polygon_support","sha":"793c9658ab655726f8898fe6cdd1875c59437235","user":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"repo":{"id":36354077,"name":"osmaxx-conversion-service","full_name":"geometalab/osmaxx-conversion-service","owner":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geometalab/osmaxx-conversion-service","description":"Downloads OSM data, imports it into PostgreSQL, transforms it, exports it into various formats","fork":false,"url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service","forks_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/forks","keys_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/teams","hooks_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/hooks","issue_events_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/issues/events{/number}","events_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/events","assignees_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/assignees{/user}","branches_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/branches{/branch}","tags_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/tags","blobs_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/statuses/{sha}","languages_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/languages","stargazers_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/stargazers","contributors_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/contributors","subscribers_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/subscribers","subscription_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/subscription","commits_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/contents/{+path}","compare_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/merges","archive_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/downloads","issues_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/issues{/number}","pulls_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/pulls{/number}","milestones_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/milestones{/number}","notifications_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/labels{/name}","releases_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/releases{/id}","deployments_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/deployments","created_at":"2015-05-27T08:35:02Z","updated_at":"2016-01-13T15:26:54Z","pushed_at":"2016-02-18T15:21:29Z","git_url":"git://github.com/geometalab/osmaxx-conversion-service.git","ssh_url":"git@github.com:geometalab/osmaxx-conversion-service.git","clone_url":"https://github.com/geometalab/osmaxx-conversion-service.git","svn_url":"https://github.com/geometalab/osmaxx-conversion-service","homepage":null,"size":47698,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":25,"forks":1,"open_issues":25,"watchers":1,"default_branch":"develop"}},"base":{"label":"geometalab:develop","ref":"develop","sha":"636adde1bd2e29746cee87b3158c62e91195919d","user":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"repo":{"id":36354077,"name":"osmaxx-conversion-service","full_name":"geometalab/osmaxx-conversion-service","owner":{"login":"geometalab","id":8266374,"avatar_url":"https://avatars.githubusercontent.com/u/8266374?v=3","gravatar_id":"","url":"https://api.github.com/users/geometalab","html_url":"https://github.com/geometalab","followers_url":"https://api.github.com/users/geometalab/followers","following_url":"https://api.github.com/users/geometalab/following{/other_user}","gists_url":"https://api.github.com/users/geometalab/gists{/gist_id}","starred_url":"https://api.github.com/users/geometalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geometalab/subscriptions","organizations_url":"https://api.github.com/users/geometalab/orgs","repos_url":"https://api.github.com/users/geometalab/repos","events_url":"https://api.github.com/users/geometalab/events{/privacy}","received_events_url":"https://api.github.com/users/geometalab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geometalab/osmaxx-conversion-service","description":"Downloads OSM data, imports it into PostgreSQL, transforms it, exports it into various formats","fork":false,"url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service","forks_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/forks","keys_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/teams","hooks_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/hooks","issue_events_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/issues/events{/number}","events_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/events","assignees_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/assignees{/user}","branches_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/branches{/branch}","tags_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/tags","blobs_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/statuses/{sha}","languages_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/languages","stargazers_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/stargazers","contributors_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/contributors","subscribers_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/subscribers","subscription_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/subscription","commits_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/contents/{+path}","compare_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/merges","archive_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/downloads","issues_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/issues{/number}","pulls_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/pulls{/number}","milestones_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/milestones{/number}","notifications_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/labels{/name}","releases_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/releases{/id}","deployments_url":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/deployments","created_at":"2015-05-27T08:35:02Z","updated_at":"2016-01-13T15:26:54Z","pushed_at":"2016-02-18T15:21:29Z","git_url":"git://github.com/geometalab/osmaxx-conversion-service.git","ssh_url":"git@github.com:geometalab/osmaxx-conversion-service.git","clone_url":"https://github.com/geometalab/osmaxx-conversion-service.git","svn_url":"https://github.com/geometalab/osmaxx-conversion-service","homepage":null,"size":47698,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":25,"forks":1,"open_issues":25,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/pulls/119"},"html":{"href":"https://github.com/geometalab/osmaxx-conversion-service/pull/119"},"issue":{"href":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/issues/119"},"comments":{"href":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/issues/119/comments"},"review_comments":{"href":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/pulls/119/comments"},"review_comment":{"href":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/pulls/119/commits"},"statuses":{"href":"https://api.github.com/repos/geometalab/osmaxx-conversion-service/statuses/793c9658ab655726f8898fe6cdd1875c59437235"}}}}