-
Notifications
You must be signed in to change notification settings - Fork 115
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
Initial work to increase coverage on robottelo.cli module #4707
Conversation
using pytest parametrize and pytest-mock added some tests to assert the call of cli methods more tests will be added later
@rochacbruno, thanks for your PR! By analyzing the history of the files in this pull request, we identified @renzon, @rplevka and @sghai to be potential reviewers. |
@@ -566,7 +566,7 @@ def configure_puppet_test(): | |||
puppet_env.location.append(loc) | |||
puppet_env.organization.append(org) | |||
puppet_env = puppet_env.update(['location', 'organization']) | |||
Proxy.importclasses({ | |||
Proxy.import_classes({ |
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.
renamed this method to keep the standard with all other method names. (grepped and renamed all references)
@@ -33,7 +33,7 @@ def _csv_reader(output): | |||
data = data.encode('utf8') | |||
handler = StringIO(data) | |||
|
|||
for row in csv.reader(handler): | |||
for row in csv.reader(handler): # pragma: no cover |
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.
Added no cover
here because it is difficult to merge coverage reports for python 2 and 3 in final report
@@ -367,6 +367,8 @@ def test_parse_info(self): | |||
' Repo ID: 10', | |||
' 2) Repo Name: repo2', | |||
' Repo ID: 20', | |||
' 3) Repo Name => repo3', | |||
' Repo ID => 30', |
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.
included =>
to test this alternative format and hit the parser.
Codecov Report
@@ Coverage Diff @@
## master #4707 +/- ##
==========================================
+ Coverage 40.48% 41.47% +0.98%
==========================================
Files 89 89
Lines 7121 7113 -8
==========================================
+ Hits 2883 2950 +67
+ Misses 4238 4163 -75
Continue to review full report at Codecov.
|
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
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
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
using pytest parametrize and pytest-mock
added some tests to assert the call of cli methods
more tests will be added later
NOTE: Using pytest style for robottelo tests, while for
tests/forreman
we keep usingunittest
for compatibility with Junit reports andsubTest
. Fortests/robottelo
we can usepytest
or even mix it withunittest
.