Mock Framework in Unit-tests
Summary
=======
mock framework is included in Python 3 standard library and is available for Python 2.x too
Motivation
========
Mock has more friendly assertion error messages than mox3 does and supported well. mox3 is a mock fork with Python 3.x compatibility supported by OpenStack.
Description
=========
We have to migrate to mock step by step existing tests and introduce new with mock only.
Testing
======
All new unit- tests should be written with mock
Outside Dependencies
==================
mock for Python 2.x
Requirements Update Required
=======
We have to add mock library to our tests-requireme
Doc Impact
=========
Development documentation should be updated with needed instructions.
Blueprint information
- Status:
- Started
- Approver:
- Ying Zuo
- Priority:
- High
- Drafter:
- Ivan Kolodyazhny
- Direction:
- Approved
- Assignee:
- Ivan Kolodyazhny
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Good progress
- Milestone target:
- next
- Started by
- Ying Zuo
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Progress tracking https:/
----
[amotoki - Feb 17, 2018] Raising the priority to High due to the community goal
[amotoki - Jan 22, 2018] There is no good progress in reviews. Let's move it to Rocky.
----
Gerrit topic: https:/
Addressed by: https:/
Switch cinder-related tests to mock
Addressed by: https:/
Switch Cinder-related tests to mock
Addressed by: https:/
Switch Cinder-related tests to mock
Addressed by: https:/
Switch Glance-related tests to mock
Addressed by: https:/
Switch Glance-related tests to mock
Addressed by: https:/
Switch Glance-related tests (dashboards.
Addressed by: https:/
Provide a way to disable mox completely
Addressed by: https:/
Switch Nova API tests to mock
Addressed by: https:/
Switch swift API tests to mock
Addressed by: https:/
Switch Neutron/Network API tests to mock
Addressed by: https:/
Switch Keystone API tests to mock
Addressed by: https:/
Mark other API related tests with mox free
Addressed by: https:/
Switch horizon UT from mox to mock
Addressed by: https:/
Minor fix on mock migrated tests
Addressed by: https:/
Switch project.
Addressed by: https:/
Convert project tests into mock
Addressed by: https:/
Convert project tests into mock: api_access/
Addressed by: https:/
Convert project tests into mock: cgroups/
Addressed by: https:/
Switch project.
Addressed by: https:/
Use mock.patch to setup test objects
Addressed by: https:/
Implement create_mocks decorator to make mocks easier
Addressed by: https:/
Switch test_quotas to mock
Addressed by: https:/
Switch settings password tests to mock
Addressed by: https:/
Switch project networks tests to mock
Addressed by: https:/
Switch project neworks.ports to mock
Addressed by: https:/
Convert admin.snapshots tests into mock
Addressed by: https:/
Convert admin volume_types tests into mock
Addressed by: https:/
Make create_mocks compatible with create_stubs
Addressed by: https:/
Add assert_
Addressed by: https:/
Switch project instances tests to mock
Addressed by: https:/
Update docstring of test.helpers.
Addressed by: https:/
Start using create_mocks in dashboards/
Addressed by: https:/
Convert admin.aggregates tests into mock
Addressed by: https:/
Convert admin.floating_ips tests into mock
Addressed by: https:/
Improve mocking in REST API tests (test_neutron)
Addressed by: https:/
Convert admin.metadata_defs tests into mock
Addressed by: https:/
Convert admin.instances tests into mock
Addressed by: https:/
Convert admin.info tests into mock
Addressed by: https:/
Convert admin.hypervisors tests into mock
Addressed by: https:/
Convert admin.hyperviso
Addressed by: https:/
Convert admin.defaults tests into mock
Gerrit topic: https:/
Addressed by: https:/
Simplify APIMockTestCase
Addressed by: https:/
Remove remaining mox usage in tests converted to mock
Addressed by: https:/
Disable mox usage by default in test helper
Addressed by: https:/
Convert identity.roles tests into mock
Addressed by: https:/
Convert identity.mappings tests into mock
Addressed by: https:/
Convert identity.
Addressed by: https:/
Convert identity.domains tests into mock
Addressed by: https:/
Convert identity.groups tests into mock
Addressed by: https:/
Convert identity.users tests into mock
Addressed by: https:/
Convert identity.projects tests into mock (partial)
Addressed by: https:/
Convert project.images tests
Addressed by: https:/
Convert admin.flavors tests into mock
Addressed by: https:/
Convert admin.networks.
Addressed by: https:/
Convert admin.networks.
Addressed by: https:/
Convert admin.overview tests into mock
Addressed by: https:/
Convert admin.networks tests into mock
Addressed by: https:/
Convert admin.networks.
Addressed by: https:/
Drop mox usage in Selenium tests
Addressed by: https:/
Drop use_mox from horizon test helpers
Addressed by: https:/
Fix confusing variable names in unit tests