-
Notifications
You must be signed in to change notification settings - Fork 114
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
[Customer Case] Test for creating a host with lce specified #14321
[Customer Case] Test for creating a host with lce specified #14321
Conversation
trigger: test-robottelo |
PRT Result
|
tests/foreman/cli/test_host.py
Outdated
} | ||
) | ||
hosts = module_target_sat.cli.Host.list({'organization-id': module_org.id}) | ||
for i in hosts: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use something like
assert 'string' in [item['name'] for item in list_of_something]
... and get rid of the unnecessary variable, loop and iterating through a dict!
tests/foreman/cli/test_host.py
Outdated
if new_host.name in i.values(): | ||
found_host = True | ||
break | ||
assert found_host is True, 'Assertion failed: host not found' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You can delete this using my comment above
- We don't do
assert x is True
, justassert x
is enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good for me pending @lhellebr's comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK if PRT passes
trigger: test-robottelo |
found_host = any(new_host.name in i.values() for i in hosts) | ||
assert found_host, 'Assertion failed: host not found' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking
found_host = any(new_host.name in i.values() for i in hosts) | |
assert found_host, 'Assertion failed: host not found' | |
assert any(new_host.name in i.values() for i in hosts), 'Assertion failed: host not found' |
PRT Result
|
trigger: test-robottelo |
PRT Result
|
b9b21f8
to
e284c84
Compare
e284c84
to
1b127f3
Compare
1b127f3
to
458e78d
Compare
* Test for creating a host with lce specified * addressing comments * rebase and adding to docstring * fixing docstring issue (cherry picked from commit 4e13993)
…15006) [Customer Case] Test for creating a host with lce specified (#14321) * Test for creating a host with lce specified * addressing comments * rebase and adding to docstring * fixing docstring issue (cherry picked from commit 4e13993) Co-authored-by: Cole Higgins <[email protected]>
…eQE#14321) * Test for creating a host with lce specified * addressing comments * rebase and adding to docstring * fixing docstring issue
Problem Statement
hammer host create did not previously support --lifecycle-environment options, only --lifecycle-environment-id
Now users should be able to create a host with --lifecycle-environment ['name'] set
Solution
Automation to create a host using the --lifecycle-environment option