Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CRUDs for missing fields for API Hosts entity #4118

Merged
merged 2 commits into from
Jan 2, 2017
Merged

Add CRUDs for missing fields for API Hosts entity #4118

merged 2 commits into from
Jan 2, 2017

Conversation

svtkachenko
Copy link
Contributor

Part of #3270, depends on SatelliteQE/nailgun#346 and SatelliteQE/nailgun#347.
test_positive_update_provision_method was not added as "Provision method can't be updated after host is provisioned".

% pytest -v tests/foreman/api/test_host.py -k 'test_positive_create_with_puppet_class or test_positive_create_with_content_view or test_positive_create_with_host_parameters or test_positive_create_with_image or test_positive_create_with_provision_method or test_positive_update_puppet_class or test_positive_update_content_view or test_positive_update_host_parameters or test_positive_update_image or test_positive_update_provision_method'
===================================================================== test session starts =====================================================================
platform linux2 -- Python 2.7.12, pytest-3.0.4, py-1.4.31, pluggy-0.4.0 -- /home/qui/code/venv/2/bin/python2
cachedir: .cache
rootdir: /home/qui/code/robottelo, inifile: 
plugins: xdist-1.15.0, html-1.12.0, cov-2.4.0
collected 60 items 

tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_content_view <- robottelo/decorators/__init__.py PASSED
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_host_parameters <- robottelo/decorators/__init__.py PASSED
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_image <- robottelo/decorators/__init__.py PASSED
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_provision_method <- robottelo/decorators/__init__.py PASSED
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_puppet_class <- robottelo/decorators/__init__.py PASSED
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_content_view <- robottelo/decorators/__init__.py PASSED
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_host_parameters <- robottelo/decorators/__init__.py PASSED
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_image <- robottelo/decorators/__init__.py PASSED
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_puppet_class <- robottelo/decorators/__init__.py PASSED

===================================================================== 51 tests deselected =====================================================================
========================================================== 9 passed, 51 deselected in 177.73 seconds ==========================================================

@svtkachenko svtkachenko added 6.3 API Issues and PRs involving the API labels Dec 23, 2016
@coveralls
Copy link

Coverage Status

Coverage remained the same at 74.596% when pulling f651cdc on svtkachenko:host_cruds into 07ef69c on SatelliteQE:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 74.596% when pulling f651cdc on svtkachenko:host_cruds into 07ef69c on SatelliteQE:master.

@@ -22,7 +22,11 @@
from fauxfactory import gen_integer, gen_ipaddr, gen_mac, gen_string
from nailgun import client, entities
from requests.exceptions import HTTPError
from six.moves import http_client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you move it there? Put it back and remove redundant empty line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't six a third-party module?
And according to http://robottelo.readthedocs.io/en/latest/code_standards.html#recommended
third-party should be placed before application-specific and separated with a blank line between groups of imports.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you and most of times I refactored my code to put them all together. I knew pep8 state about importing but never realized robottello doc itself mention the exactly same format. Maybe it's worth a email or issue discussion about it so everyone get aware of this. I would be happier once Pycharm follow pep 8 as well ;)

super(HostTestCase, cls).setUpClass()
cls.org = entities.Organization().create()
cls.loc = entities.Location(organization=[cls.org]).create()
# Content View and repository reloated entities
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reloated?

query={'search': u'content_view="{0}"'.format(cls.cv.name)}
)[0].read()
cls.lce = entities.LifecycleEnvironment().search(query={
'search': 'name=Library and organization_id={0}'.format(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name=ENVIRONMENT

@@ -383,6 +437,95 @@ def test_positive_create_with_compute_profile(self):
self.assertEqual(host.compute_profile.read().name, profile.name)

@run_only_on('sat')
@tier2
def test_positive_create_with_content_view(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oshtaier
Copy link
Contributor

ACK pending nitpicks

@coveralls
Copy link

coveralls commented Dec 28, 2016

Coverage Status

Coverage remained the same at 74.596% when pulling c1f7bd2 on svtkachenko:host_cruds into 07ef69c on SatelliteQE:master.

Copy link
Contributor

@renzon renzon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@renzon renzon merged commit 385b203 into SatelliteQE:master Jan 2, 2017
@renzon renzon removed the review label Jan 2, 2017
abalakh pushed a commit that referenced this pull request Jan 30, 2017
* Add CRUDs for missing fields for API Hosts entity (#4118)

* Add CRUDs for missing fields for API Hosts entity

* Changes according to review comments.

* Changes specific for 6.2
@svtkachenko svtkachenko deleted the host_cruds branch February 22, 2017 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Issues and PRs involving the API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants