{"action":"created","comment":{"url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments/33262038","id":33262038,"diff_hunk":"@@ -0,0 +1,125 @@\n+\"\"\"Unit tests for the ``fusor/api/v21/deployments`` paths.\"\"\"\n+from ddt import data, ddt\n+from fauxfactory import gen_string\n+from nailgun import entities\n+from requests.exceptions import HTTPError\n+from robottelo.test import APITestCase\n+# (too-many-public-methods) pylint:disable=too-many-public-methods\n+\n+\n+@ddt\n+class RHCIDeploymentTestCase(APITestCase):\n+    \"\"\"Tests for the RHCI deployment API.\"\"\"\n+\n+    @classmethod\n+    def setUpClass(cls):\n+        \"\"\" Setup the base entities for all tests. \"\"\"\n+        super(RHCIDeploymentTestCase, cls).setUpClass()\n+        cls.org = entities.Organization().create_json()\n+        cls.lc_env = entities.LifecycleEnvironment(\n+            organization=cls.org['organization']['id']).create()\n+        cls.rhev_engine_host = entities.Host(id=3)\n+        # cls.rhev_engine_host = entities.Host(\n+        #     organization=cls.org['organization']['id']).create()\n+        cls.to_delete = []\n+\n+    @classmethod\n+    def tearDownClass(cls):\n+        \"\"\" Delete deployments designated during testing. \"\"\"\n+        super(RHCIDeploymentTestCase, cls).tearDownClass()\n+        print cls.to_delete\n+        for deployment in cls.to_delete:\n+            deployment.delete()\n+\n+    @data(\n+        gen_string(str_type='alpha'),\n+        gen_string(str_type='alphanumeric'),\n+        gen_string(str_type='cjk'),\n+        gen_string(str_type='latin1'),\n+    )\n+    def test_positive_create_deployment(self, data):\n+        \"\"\"@Test: Create a simple deployment.\n+\n+        @Assert: An RHCI deployment is created with a random name.\n+\n+        @Feature: RHCI Deployment\n+\n+        \"\"\"\n+        deployment = entities.RHCIDeployment(\n+            name=data,\n+            organization=self.org['organization']['id'],\n+            lifecycle_environment=self.lc_env.id,\n+            deploy_rhev=True,\n+            rhev_engine_host=self.rhev_engine_host.id,\n+            rhev_storage_type='NFS',\n+            rhev_engine_admin_password='changeme',\n+        ).create()\n+        self.assertEquals(deployment.name, data)\n+        self.assertEqual(\n+            deployment.organization.id, self.org['organization']['id'])\n+        self.assertEqual(deployment.lifecycle_environment.id, self.lc_env.id)\n+        self.to_delete.append(deployment)\n+\n+    @data(\n+        {'name': gen_string(str_type='alpha'),\n+         'new-name': gen_string(str_type='alpha')},\n+        {'name': gen_string(str_type='alphanumeric'),\n+         'new-name': gen_string(str_type='alphanumeric')},\n+        {'name': gen_string(str_type='cjk'),\n+         'new-name': gen_string(str_type='cjk')},\n+        {'name': gen_string(str_type='latin1'),\n+         'new-name': gen_string(str_type='latin1')},\n+    )\n+    def test_positive_update_name(self, data):\n+        \"\"\"@Test: Update a deployment's name.\n+\n+        @Assert: An RHCI deployment is updated with a random name.\n+\n+        @Feature: RHCI Deployment\n+\n+        \"\"\"\n+        deployment = entities.RHCIDeployment(\n+            name=data['name'],\n+            organization=self.org['organization']['id'],\n+            lifecycle_environment=self.lc_env.id,\n+            deploy_rhev=True,\n+            rhev_engine_host=self.rhev_engine_host.id,\n+            rhev_storage_type='NFS',\n+            rhev_engine_admin_password='changeme',\n+        ).create()\n+        self.assertEquals(deployment.name, data['name'])\n+\n+        # perform the update\n+        deployment.name = data['new-name']\n+        deployment = deployment.update(['name'])\n+        self.assertEqual(deployment.name, data['new-name'])\n+        self.to_delete.append(deployment)\n+\n+    @data(\n+        gen_string(str_type='alpha'),\n+    )\n+    def test_positive_delete_deployment(self, data):\n+        \"\"\"@Test: Create and delete a simple deployment.\n+\n+        @Assert: An RHCI deployment is deleted.\n+\n+        @Feature: RHCI Deployment\n+\n+        \"\"\"\n+        deployment = entities.RHCIDeployment(\n+            name=data,\n+            organization=self.org['organization']['id'],\n+            lifecycle_environment=self.lc_env.id,\n+            deploy_rhev=True,\n+            rhev_engine_host=self.rhev_engine_host.id,\n+            rhev_storage_type='NFS',\n+            rhev_engine_admin_password='changeme',\n+        ).create()","path":"tests/foreman/api/test_rhci.py","position":117,"original_position":117,"commit_id":"70c56281bdd8b3b9e68737dbaffa909c1ec1bab6","original_commit_id":"70c56281bdd8b3b9e68737dbaffa909c1ec1bab6","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":"Again, you can drop IDs.","created_at":"2015-06-25T14:42:36Z","updated_at":"2015-06-25T14:42:36Z","html_url":"https://github.com/SatelliteQE/robottelo/pull/2440#discussion_r33262038","pull_request_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2440","_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments/33262038"},"html":{"href":"https://github.com/SatelliteQE/robottelo/pull/2440#discussion_r33262038"},"pull_request":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2440"}}},"pull_request":{"url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2440","id":37597505,"html_url":"https://github.com/SatelliteQE/robottelo/pull/2440","diff_url":"https://github.com/SatelliteQE/robottelo/pull/2440.diff","patch_url":"https://github.com/SatelliteQE/robottelo/pull/2440.patch","issue_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2440","number":2440,"state":"open","locked":false,"title":"[Do Not Merge] Add initial RHCI tests","user":{"login":"JacobCallahan","id":6618303,"avatar_url":"https://avatars.githubusercontent.com/u/6618303?v=3","gravatar_id":"","url":"https://api.github.com/users/JacobCallahan","html_url":"https://github.com/JacobCallahan","followers_url":"https://api.github.com/users/JacobCallahan/followers","following_url":"https://api.github.com/users/JacobCallahan/following{/other_user}","gists_url":"https://api.github.com/users/JacobCallahan/gists{/gist_id}","starred_url":"https://api.github.com/users/JacobCallahan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JacobCallahan/subscriptions","organizations_url":"https://api.github.com/users/JacobCallahan/orgs","repos_url":"https://api.github.com/users/JacobCallahan/repos","events_url":"https://api.github.com/users/JacobCallahan/events{/privacy}","received_events_url":"https://api.github.com/users/JacobCallahan/received_events","type":"User","site_admin":false},"body":"These tests cover some of the basic functionality for creating, modifying, and deleting RHCI deployments\r\n\r\n$ nosetests -v tests/foreman/api/test_rhci.py\r\n@Test: Create a simple deployment. ... ok\r\n@Test: Create a simple deployment. ... ok\r\n@Test: Create a simple deployment. ... ok\r\n@Test: Create a simple deployment. ... ok\r\n@Test: Create and delete a simple deployment. ... ok\r\n@Test: Update a deployment's name. ... ok\r\n@Test: Update a deployment's name. ... ok\r\n@Test: Update a deployment's name. ... ok\r\n@Test: Update a deployment's name. ... ok\r\n\r\nRan 9 tests in 2.196s\r\n\r\nOK","created_at":"2015-06-12T19:42:45Z","updated_at":"2015-06-25T14:42:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"757e3d1eb9a1411e9a283a4f5a97aa8bfedc8192","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2440/commits","review_comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2440/comments","review_comment_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2440/comments","statuses_url":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/70c56281bdd8b3b9e68737dbaffa909c1ec1bab6","head":{"label":"JacobCallahan:rhci","ref":"rhci","sha":"70c56281bdd8b3b9e68737dbaffa909c1ec1bab6","user":{"login":"JacobCallahan","id":6618303,"avatar_url":"https://avatars.githubusercontent.com/u/6618303?v=3","gravatar_id":"","url":"https://api.github.com/users/JacobCallahan","html_url":"https://github.com/JacobCallahan","followers_url":"https://api.github.com/users/JacobCallahan/followers","following_url":"https://api.github.com/users/JacobCallahan/following{/other_user}","gists_url":"https://api.github.com/users/JacobCallahan/gists{/gist_id}","starred_url":"https://api.github.com/users/JacobCallahan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JacobCallahan/subscriptions","organizations_url":"https://api.github.com/users/JacobCallahan/orgs","repos_url":"https://api.github.com/users/JacobCallahan/repos","events_url":"https://api.github.com/users/JacobCallahan/events{/privacy}","received_events_url":"https://api.github.com/users/JacobCallahan/received_events","type":"User","site_admin":false},"repo":{"id":24058307,"name":"robottelo","full_name":"JacobCallahan/robottelo","owner":{"login":"JacobCallahan","id":6618303,"avatar_url":"https://avatars.githubusercontent.com/u/6618303?v=3","gravatar_id":"","url":"https://api.github.com/users/JacobCallahan","html_url":"https://github.com/JacobCallahan","followers_url":"https://api.github.com/users/JacobCallahan/followers","following_url":"https://api.github.com/users/JacobCallahan/following{/other_user}","gists_url":"https://api.github.com/users/JacobCallahan/gists{/gist_id}","starred_url":"https://api.github.com/users/JacobCallahan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JacobCallahan/subscriptions","organizations_url":"https://api.github.com/users/JacobCallahan/orgs","repos_url":"https://api.github.com/users/JacobCallahan/repos","events_url":"https://api.github.com/users/JacobCallahan/events{/privacy}","received_events_url":"https://api.github.com/users/JacobCallahan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JacobCallahan/robottelo","description":"An automation testing framework for the Katello project.","fork":true,"url":"https://api.github.com/repos/JacobCallahan/robottelo","forks_url":"https://api.github.com/repos/JacobCallahan/robottelo/forks","keys_url":"https://api.github.com/repos/JacobCallahan/robottelo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JacobCallahan/robottelo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JacobCallahan/robottelo/teams","hooks_url":"https://api.github.com/repos/JacobCallahan/robottelo/hooks","issue_events_url":"https://api.github.com/repos/JacobCallahan/robottelo/issues/events{/number}","events_url":"https://api.github.com/repos/JacobCallahan/robottelo/events","assignees_url":"https://api.github.com/repos/JacobCallahan/robottelo/assignees{/user}","branches_url":"https://api.github.com/repos/JacobCallahan/robottelo/branches{/branch}","tags_url":"https://api.github.com/repos/JacobCallahan/robottelo/tags","blobs_url":"https://api.github.com/repos/JacobCallahan/robottelo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JacobCallahan/robottelo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JacobCallahan/robottelo/git/refs{/sha}","trees_url":"https://api.github.com/repos/JacobCallahan/robottelo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JacobCallahan/robottelo/statuses/{sha}","languages_url":"https://api.github.com/repos/JacobCallahan/robottelo/languages","stargazers_url":"https://api.github.com/repos/JacobCallahan/robottelo/stargazers","contributors_url":"https://api.github.com/repos/JacobCallahan/robottelo/contributors","subscribers_url":"https://api.github.com/repos/JacobCallahan/robottelo/subscribers","subscription_url":"https://api.github.com/repos/JacobCallahan/robottelo/subscription","commits_url":"https://api.github.com/repos/JacobCallahan/robottelo/commits{/sha}","git_commits_url":"https://api.github.com/repos/JacobCallahan/robottelo/git/commits{/sha}","comments_url":"https://api.github.com/repos/JacobCallahan/robottelo/comments{/number}","issue_comment_url":"https://api.github.com/repos/JacobCallahan/robottelo/issues/comments{/number}","contents_url":"https://api.github.com/repos/JacobCallahan/robottelo/contents/{+path}","compare_url":"https://api.github.com/repos/JacobCallahan/robottelo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JacobCallahan/robottelo/merges","archive_url":"https://api.github.com/repos/JacobCallahan/robottelo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JacobCallahan/robottelo/downloads","issues_url":"https://api.github.com/repos/JacobCallahan/robottelo/issues{/number}","pulls_url":"https://api.github.com/repos/JacobCallahan/robottelo/pulls{/number}","milestones_url":"https://api.github.com/repos/JacobCallahan/robottelo/milestones{/number}","notifications_url":"https://api.github.com/repos/JacobCallahan/robottelo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JacobCallahan/robottelo/labels{/name}","releases_url":"https://api.github.com/repos/JacobCallahan/robottelo/releases{/id}","created_at":"2014-09-15T13:53:21Z","updated_at":"2015-05-06T20:21:45Z","pushed_at":"2015-06-25T14:11:13Z","git_url":"git://github.com/JacobCallahan/robottelo.git","ssh_url":"git@github.com:JacobCallahan/robottelo.git","clone_url":"https://github.com/JacobCallahan/robottelo.git","svn_url":"https://github.com/JacobCallahan/robottelo","homepage":null,"size":8556,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SatelliteQE:master","ref":"master","sha":"20169b979f96192562841af7eff0e042df6e03c0","user":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"repo":{"id":4000279,"name":"robottelo","full_name":"SatelliteQE/robottelo","owner":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SatelliteQE/robottelo","description":"Robottelo is a test suite which exercises The Foreman.","fork":false,"url":"https://api.github.com/repos/SatelliteQE/robottelo","forks_url":"https://api.github.com/repos/SatelliteQE/robottelo/forks","keys_url":"https://api.github.com/repos/SatelliteQE/robottelo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SatelliteQE/robottelo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SatelliteQE/robottelo/teams","hooks_url":"https://api.github.com/repos/SatelliteQE/robottelo/hooks","issue_events_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/events{/number}","events_url":"https://api.github.com/repos/SatelliteQE/robottelo/events","assignees_url":"https://api.github.com/repos/SatelliteQE/robottelo/assignees{/user}","branches_url":"https://api.github.com/repos/SatelliteQE/robottelo/branches{/branch}","tags_url":"https://api.github.com/repos/SatelliteQE/robottelo/tags","blobs_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/refs{/sha}","trees_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/{sha}","languages_url":"https://api.github.com/repos/SatelliteQE/robottelo/languages","stargazers_url":"https://api.github.com/repos/SatelliteQE/robottelo/stargazers","contributors_url":"https://api.github.com/repos/SatelliteQE/robottelo/contributors","subscribers_url":"https://api.github.com/repos/SatelliteQE/robottelo/subscribers","subscription_url":"https://api.github.com/repos/SatelliteQE/robottelo/subscription","commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/commits{/sha}","git_commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/commits{/sha}","comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/comments{/number}","issue_comment_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/comments{/number}","contents_url":"https://api.github.com/repos/SatelliteQE/robottelo/contents/{+path}","compare_url":"https://api.github.com/repos/SatelliteQE/robottelo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SatelliteQE/robottelo/merges","archive_url":"https://api.github.com/repos/SatelliteQE/robottelo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SatelliteQE/robottelo/downloads","issues_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues{/number}","pulls_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls{/number}","milestones_url":"https://api.github.com/repos/SatelliteQE/robottelo/milestones{/number}","notifications_url":"https://api.github.com/repos/SatelliteQE/robottelo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SatelliteQE/robottelo/labels{/name}","releases_url":"https://api.github.com/repos/SatelliteQE/robottelo/releases{/id}","created_at":"2012-04-12T01:36:39Z","updated_at":"2015-06-23T17:21:41Z","pushed_at":"2015-06-25T14:11:14Z","git_url":"git://github.com/SatelliteQE/robottelo.git","ssh_url":"git@github.com:SatelliteQE/robottelo.git","clone_url":"https://github.com/SatelliteQE/robottelo.git","svn_url":"https://github.com/SatelliteQE/robottelo","homepage":"","size":17505,"stargazers_count":22,"watchers_count":22,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":28,"mirror_url":null,"open_issues_count":209,"forks":28,"open_issues":209,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2440"},"html":{"href":"https://github.com/SatelliteQE/robottelo/pull/2440"},"issue":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2440"},"comments":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2440/comments"},"review_comments":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2440/comments"},"review_comment":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2440/commits"},"statuses":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/70c56281bdd8b3b9e68737dbaffa909c1ec1bab6"}}}}