{"action":"created","comment":{"url":"https://api.github.com/repos/PulpQE/pulp-smash/pulls/comments/60074865","id":60074865,"diff_hunk":"@@ -0,0 +1,78 @@\n+# coding=utf-8\n+\"\"\"Tests for how well Pulp can deal with duplicate uploads.\n+\n+This module targets `Pulp #1406`_ and `Pulp Smash #81`_. The test procedure is\n+as follows:\n+\n+1. Create a new feed-less repository.\n+2. Upload content and import it into the repository. Assert the upload and\n+   import was successful.\n+3. Upload identical content and import it into the repository.\n+\n+The second upload should silently fail for all Pulp releases in the 2.x series.\n+\n+.. _Pulp #1406: https://pulp.plan.io/issues/1406\n+.. _Pulp Smash #81: https://github.com/PulpQE/pulp-smash/issues/81\n+\"\"\"\n+from __future__ import unicode_literals\n+\n+from pulp_smash import api, utils\n+from pulp_smash.compat import urljoin\n+from pulp_smash.constants import (\n+    CONTENT_UPLOAD_PATH,\n+    PUPPET_MODULE_URL,\n+    REPOSITORY_PATH,\n+)\n+from pulp_smash.tests.puppet.api_v2.utils import gen_repo\n+\n+\n+def _upload_import_puppet_module(server_config, puppet_module, repo_href):\n+    \"\"\"Upload a puppet module and import it into a repository.\n+\n+    Return the JSON-decoded body of the call report received when importing the\n+    Puppet module.\n+    \"\"\"\n+    client = api.Client(server_config, api.json_handler)\n+    malloc = client.post(CONTENT_UPLOAD_PATH)","path":"pulp_smash/tests/puppet/api_v2/test_duplicate_uploads.py","position":36,"original_position":36,"commit_id":"ba187573a8716990012b374bb85bf0e80d03a573","original_commit_id":"ba187573a8716990012b374bb85bf0e80d03a573","user":{"login":"elyezer","id":48132,"avatar_url":"https://avatars.githubusercontent.com/u/48132?v=3","gravatar_id":"","url":"https://api.github.com/users/elyezer","html_url":"https://github.com/elyezer","followers_url":"https://api.github.com/users/elyezer/followers","following_url":"https://api.github.com/users/elyezer/following{/other_user}","gists_url":"https://api.github.com/users/elyezer/gists{/gist_id}","starred_url":"https://api.github.com/users/elyezer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elyezer/subscriptions","organizations_url":"https://api.github.com/users/elyezer/orgs","repos_url":"https://api.github.com/users/elyezer/repos","events_url":"https://api.github.com/users/elyezer/events{/privacy}","received_events_url":"https://api.github.com/users/elyezer/received_events","type":"User","site_admin":false},"body":"malloc?","created_at":"2016-04-18T15:04:45Z","updated_at":"2016-04-18T15:04:45Z","html_url":"https://github.com/PulpQE/pulp-smash/pull/203#discussion_r60074865","pull_request_url":"https://api.github.com/repos/PulpQE/pulp-smash/pulls/203","_links":{"self":{"href":"https://api.github.com/repos/PulpQE/pulp-smash/pulls/comments/60074865"},"html":{"href":"https://github.com/PulpQE/pulp-smash/pull/203#discussion_r60074865"},"pull_request":{"href":"https://api.github.com/repos/PulpQE/pulp-smash/pulls/203"}}},"pull_request":{"url":"https://api.github.com/repos/PulpQE/pulp-smash/pulls/203","id":66538159,"html_url":"https://github.com/PulpQE/pulp-smash/pull/203","diff_url":"https://github.com/PulpQE/pulp-smash/pull/203.diff","patch_url":"https://github.com/PulpQE/pulp-smash/pull/203.patch","issue_url":"https://api.github.com/repos/PulpQE/pulp-smash/issues/203","number":203,"state":"open","locked":false,"title":"Add test for duplicate uploads of a Puppet module","user":{"login":"Ichimonji10","id":1012989,"avatar_url":"https://avatars.githubusercontent.com/u/1012989?v=3","gravatar_id":"","url":"https://api.github.com/users/Ichimonji10","html_url":"https://github.com/Ichimonji10","followers_url":"https://api.github.com/users/Ichimonji10/followers","following_url":"https://api.github.com/users/Ichimonji10/following{/other_user}","gists_url":"https://api.github.com/users/Ichimonji10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ichimonji10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ichimonji10/subscriptions","organizations_url":"https://api.github.com/users/Ichimonji10/orgs","repos_url":"https://api.github.com/users/Ichimonji10/repos","events_url":"https://api.github.com/users/Ichimonji10/events{/privacy}","received_events_url":"https://api.github.com/users/Ichimonji10/received_events","type":"User","site_admin":false},"body":"Add a new test case, `DuplicateUploadsTestCase`, in module\r\n`pulp_smash.tests.puppet.api_v2.test_duplicate_uploads`. This module\r\nuploads and imports a Puppet module into a single repository twice in a\r\nrow, and verifies that the procedure completes without any issues. The\r\nnew test case passes. Tests executed with:\r\n\r\n    python -m unittest2 \\\r\n        pulp_smash.tests.puppet.api_v2.test_duplicate_uploads\r\n\r\nRelated to #81.","created_at":"2016-04-14T19:14:26Z","updated_at":"2016-04-18T15:04:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"248d5dade6824f447f6160cbfd9d804ca25b86b8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PulpQE/pulp-smash/pulls/203/commits","review_comments_url":"https://api.github.com/repos/PulpQE/pulp-smash/pulls/203/comments","review_comment_url":"https://api.github.com/repos/PulpQE/pulp-smash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PulpQE/pulp-smash/issues/203/comments","statuses_url":"https://api.github.com/repos/PulpQE/pulp-smash/statuses/ba187573a8716990012b374bb85bf0e80d03a573","head":{"label":"Ichimonji10:dup-up","ref":"dup-up","sha":"ba187573a8716990012b374bb85bf0e80d03a573","user":{"login":"Ichimonji10","id":1012989,"avatar_url":"https://avatars.githubusercontent.com/u/1012989?v=3","gravatar_id":"","url":"https://api.github.com/users/Ichimonji10","html_url":"https://github.com/Ichimonji10","followers_url":"https://api.github.com/users/Ichimonji10/followers","following_url":"https://api.github.com/users/Ichimonji10/following{/other_user}","gists_url":"https://api.github.com/users/Ichimonji10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ichimonji10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ichimonji10/subscriptions","organizations_url":"https://api.github.com/users/Ichimonji10/orgs","repos_url":"https://api.github.com/users/Ichimonji10/repos","events_url":"https://api.github.com/users/Ichimonji10/events{/privacy}","received_events_url":"https://api.github.com/users/Ichimonji10/received_events","type":"User","site_admin":false},"repo":{"id":44113664,"name":"pulp-smash","full_name":"Ichimonji10/pulp-smash","owner":{"login":"Ichimonji10","id":1012989,"avatar_url":"https://avatars.githubusercontent.com/u/1012989?v=3","gravatar_id":"","url":"https://api.github.com/users/Ichimonji10","html_url":"https://github.com/Ichimonji10","followers_url":"https://api.github.com/users/Ichimonji10/followers","following_url":"https://api.github.com/users/Ichimonji10/following{/other_user}","gists_url":"https://api.github.com/users/Ichimonji10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ichimonji10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ichimonji10/subscriptions","organizations_url":"https://api.github.com/users/Ichimonji10/orgs","repos_url":"https://api.github.com/users/Ichimonji10/repos","events_url":"https://api.github.com/users/Ichimonji10/events{/privacy}","received_events_url":"https://api.github.com/users/Ichimonji10/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ichimonji10/pulp-smash","description":"A GPL-licensed Python library that facilitates easy testing of Pulp.","fork":true,"url":"https://api.github.com/repos/Ichimonji10/pulp-smash","forks_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/forks","keys_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/teams","hooks_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/hooks","issue_events_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/issues/events{/number}","events_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/events","assignees_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/assignees{/user}","branches_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/branches{/branch}","tags_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/tags","blobs_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/statuses/{sha}","languages_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/languages","stargazers_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/stargazers","contributors_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/contributors","subscribers_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/subscribers","subscription_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/subscription","commits_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/contents/{+path}","compare_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/merges","archive_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/downloads","issues_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/issues{/number}","pulls_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/pulls{/number}","milestones_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/milestones{/number}","notifications_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/labels{/name}","releases_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/releases{/id}","deployments_url":"https://api.github.com/repos/Ichimonji10/pulp-smash/deployments","created_at":"2015-10-12T14:46:15Z","updated_at":"2016-01-11T15:50:57Z","pushed_at":"2016-04-18T13:31:04Z","git_url":"git://github.com/Ichimonji10/pulp-smash.git","ssh_url":"git@github.com:Ichimonji10/pulp-smash.git","clone_url":"https://github.com/Ichimonji10/pulp-smash.git","svn_url":"https://github.com/Ichimonji10/pulp-smash","homepage":null,"size":626,"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":"master"}},"base":{"label":"PulpQE:master","ref":"master","sha":"df40d79630efcd8babc91762052a44a7ad075e74","user":{"login":"PulpQE","id":14839747,"avatar_url":"https://avatars.githubusercontent.com/u/14839747?v=3","gravatar_id":"","url":"https://api.github.com/users/PulpQE","html_url":"https://github.com/PulpQE","followers_url":"https://api.github.com/users/PulpQE/followers","following_url":"https://api.github.com/users/PulpQE/following{/other_user}","gists_url":"https://api.github.com/users/PulpQE/gists{/gist_id}","starred_url":"https://api.github.com/users/PulpQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PulpQE/subscriptions","organizations_url":"https://api.github.com/users/PulpQE/orgs","repos_url":"https://api.github.com/users/PulpQE/repos","events_url":"https://api.github.com/users/PulpQE/events{/privacy}","received_events_url":"https://api.github.com/users/PulpQE/received_events","type":"Organization","site_admin":false},"repo":{"id":43852872,"name":"pulp-smash","full_name":"PulpQE/pulp-smash","owner":{"login":"PulpQE","id":14839747,"avatar_url":"https://avatars.githubusercontent.com/u/14839747?v=3","gravatar_id":"","url":"https://api.github.com/users/PulpQE","html_url":"https://github.com/PulpQE","followers_url":"https://api.github.com/users/PulpQE/followers","following_url":"https://api.github.com/users/PulpQE/following{/other_user}","gists_url":"https://api.github.com/users/PulpQE/gists{/gist_id}","starred_url":"https://api.github.com/users/PulpQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PulpQE/subscriptions","organizations_url":"https://api.github.com/users/PulpQE/orgs","repos_url":"https://api.github.com/users/PulpQE/repos","events_url":"https://api.github.com/users/PulpQE/events{/privacy}","received_events_url":"https://api.github.com/users/PulpQE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PulpQE/pulp-smash","description":"A GPL-licensed Python library that facilitates easy testing of Pulp.","fork":false,"url":"https://api.github.com/repos/PulpQE/pulp-smash","forks_url":"https://api.github.com/repos/PulpQE/pulp-smash/forks","keys_url":"https://api.github.com/repos/PulpQE/pulp-smash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PulpQE/pulp-smash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PulpQE/pulp-smash/teams","hooks_url":"https://api.github.com/repos/PulpQE/pulp-smash/hooks","issue_events_url":"https://api.github.com/repos/PulpQE/pulp-smash/issues/events{/number}","events_url":"https://api.github.com/repos/PulpQE/pulp-smash/events","assignees_url":"https://api.github.com/repos/PulpQE/pulp-smash/assignees{/user}","branches_url":"https://api.github.com/repos/PulpQE/pulp-smash/branches{/branch}","tags_url":"https://api.github.com/repos/PulpQE/pulp-smash/tags","blobs_url":"https://api.github.com/repos/PulpQE/pulp-smash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PulpQE/pulp-smash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PulpQE/pulp-smash/git/refs{/sha}","trees_url":"https://api.github.com/repos/PulpQE/pulp-smash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PulpQE/pulp-smash/statuses/{sha}","languages_url":"https://api.github.com/repos/PulpQE/pulp-smash/languages","stargazers_url":"https://api.github.com/repos/PulpQE/pulp-smash/stargazers","contributors_url":"https://api.github.com/repos/PulpQE/pulp-smash/contributors","subscribers_url":"https://api.github.com/repos/PulpQE/pulp-smash/subscribers","subscription_url":"https://api.github.com/repos/PulpQE/pulp-smash/subscription","commits_url":"https://api.github.com/repos/PulpQE/pulp-smash/commits{/sha}","git_commits_url":"https://api.github.com/repos/PulpQE/pulp-smash/git/commits{/sha}","comments_url":"https://api.github.com/repos/PulpQE/pulp-smash/comments{/number}","issue_comment_url":"https://api.github.com/repos/PulpQE/pulp-smash/issues/comments{/number}","contents_url":"https://api.github.com/repos/PulpQE/pulp-smash/contents/{+path}","compare_url":"https://api.github.com/repos/PulpQE/pulp-smash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PulpQE/pulp-smash/merges","archive_url":"https://api.github.com/repos/PulpQE/pulp-smash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PulpQE/pulp-smash/downloads","issues_url":"https://api.github.com/repos/PulpQE/pulp-smash/issues{/number}","pulls_url":"https://api.github.com/repos/PulpQE/pulp-smash/pulls{/number}","milestones_url":"https://api.github.com/repos/PulpQE/pulp-smash/milestones{/number}","notifications_url":"https://api.github.com/repos/PulpQE/pulp-smash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PulpQE/pulp-smash/labels{/name}","releases_url":"https://api.github.com/repos/PulpQE/pulp-smash/releases{/id}","deployments_url":"https://api.github.com/repos/PulpQE/pulp-smash/deployments","created_at":"2015-10-08T00:35:48Z","updated_at":"2016-04-07T16:01:50Z","pushed_at":"2016-04-18T13:31:05Z","git_url":"git://github.com/PulpQE/pulp-smash.git","ssh_url":"git@github.com:PulpQE/pulp-smash.git","clone_url":"https://github.com/PulpQE/pulp-smash.git","svn_url":"https://github.com/PulpQE/pulp-smash","homepage":null,"size":664,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":47,"forks":18,"open_issues":47,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PulpQE/pulp-smash/pulls/203"},"html":{"href":"https://github.com/PulpQE/pulp-smash/pull/203"},"issue":{"href":"https://api.github.com/repos/PulpQE/pulp-smash/issues/203"},"comments":{"href":"https://api.github.com/repos/PulpQE/pulp-smash/issues/203/comments"},"review_comments":{"href":"https://api.github.com/repos/PulpQE/pulp-smash/pulls/203/comments"},"review_comment":{"href":"https://api.github.com/repos/PulpQE/pulp-smash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PulpQE/pulp-smash/pulls/203/commits"},"statuses":{"href":"https://api.github.com/repos/PulpQE/pulp-smash/statuses/ba187573a8716990012b374bb85bf0e80d03a573"}}}}