yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #71485
[Bug 1752917] [NEW] inappropriate mocking in openstack_dashboard/test/unit/api/rest/test_*.py
Public bug reported:
Tests under openstack_dashboard/test/unit/api/rest mocks the whole API modules like @mock.patch.patch(api, 'neutron').
It is not an appropriate mocking. We should mock only methods we really expect to call.
In addition, there are several points to be improved in these tests.
- Unnecessary usage of test.mock_factory(). Test data can be used directly.
- Related to the above, setUp() is unnecessary because they are used to prepare data with mock_factory.
- Test data should be accessed via something like self.networks.list() rather than calling TestData directly.
** Affects: horizon
Importance: High
Status: New
** Changed in: horizon
Importance: Undecided => High
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1752917
Title:
inappropriate mocking in
openstack_dashboard/test/unit/api/rest/test_*.py
Status in OpenStack Dashboard (Horizon):
New
Bug description:
Tests under openstack_dashboard/test/unit/api/rest mocks the whole API modules like @mock.patch.patch(api, 'neutron').
It is not an appropriate mocking. We should mock only methods we really expect to call.
In addition, there are several points to be improved in these tests.
- Unnecessary usage of test.mock_factory(). Test data can be used directly.
- Related to the above, setUp() is unnecessary because they are used to prepare data with mock_factory.
- Test data should be accessed via something like self.networks.list() rather than calling TestData directly.
To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1752917/+subscriptions
Follow ups