def _create_deployment(self): success, location = righteous.create_deployment( self.deployment, 'test deployment') self.assertTrue(success) self.assertTrue(location is not None) if self.delete_deployment: self.deployments.append(location) return location
def test_create_deployment(self): self.response.status_code = 201 self.response.headers["location"] = "/deployment/new_ref" nickname = "devops" description = "devops deployment" create_data = {"deployment[nickname]": nickname, "deployment[description]": description} expected = urlencode(create_data) success, location = righteous.create_deployment(nickname, description) self.request.assert_called_once_with("/deployments", method="POST", body=expected) assert success self.assertEqual(location, "/deployment/new_ref")