-
Notifications
You must be signed in to change notification settings - Fork 12
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 unit tests for coriolisclient.cli.*
modules
#81
Conversation
from cliff import command | ||
from cliff import lister | ||
from cliff import show | ||
from unittest import mock |
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.
cliff
is a third-party package, while unittest
is standard. Please separate their imports, and apply everywhere:
from cliff import command | |
from cliff import lister | |
from cliff import show | |
from unittest import mock | |
from unittest import mock | |
from cliff import command | |
from cliff import lister | |
from cliff import show |
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.
Please apply this to all the files. Other than that, this LGTM
mock_get_parser.return_value.add_argument.assert_called_once_with( | ||
'appliance_id', help="The appliance ID") |
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.
Please remove
mock_lic_status = mock.Mock() | ||
self.mock_app.client_manager.coriolis.licensing.status = \ | ||
mock_lic_status | ||
self.licensce.app = self.mock_app |
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.
Please remove
mock_get_parser.return_value.add_argument.assert_called_once_with( | ||
'appliance_id', help="The appliance ID") |
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.
Please remove
mock.sentinel.licence_pem_file | ||
mock_licence = mock.Mock() | ||
self.mock_app.client_manager.coriolis.licensing.register = mock_licence | ||
self.licensce.app = self.mock_app |
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.
Please remove
mock_get_parser.return_value.add_argument.assert_has_calls([ | ||
mock.call('appliance_id', help='The appliance ID'), | ||
mock.call('reservation_id', help='The reservation ID') | ||
]) |
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.
Please remove
mock_licensing_reservations = mock.Mock() | ||
self.mock_app.client_manager.coriolis.licensing_reservations = \ | ||
mock_licensing_reservations | ||
self.reservation.app = self.mock_app |
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.
Please remove
mock_get_parser.return_value.add_argument.assert_has_calls([ | ||
mock.call('appliance_id', help='The appliance ID'), | ||
mock.call('reservation_id', help='The reservation ID') | ||
]) |
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.
Please remove
mock_licensing_reservations = mock.Mock() | ||
self.mock_app.client_manager.coriolis.licensing_reservations = \ | ||
mock_licensing_reservations | ||
self.reservation.app = self.mock_app |
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.
Please remove
mock_licensing_server = mock.Mock() | ||
self.mock_app.client_manager.coriolis.licensing_server = \ | ||
mock_licensing_server | ||
self.server.app = self.mock_app |
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.
Please remove
9c9883b
to
d51305f
Compare
5c3461a
to
91b395b
Compare
|
||
def setUp(self): | ||
super(LicensingStatusFormatterTestCase, self).setUp() | ||
self.licensce = licensing.LicensingStatusFormatter() |
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.
Please change licensce
to either licence
or license
:D Here, and everywhere else
91b395b
to
1ccb8c2
Compare
This PR adds unit tests for
coriolisclient.cli.*
modules.