Refactor for OSC network unit tests.
Currently, there are lots of redundant code in network unit tests. And the class architecture is different from all the other test classes. So network unit test needs a refactor before we go further to implement network commands.
The refactor will go as below:
1. Using the same class inherit architecture as the other test classes.
utils.TestCommand -> TestNetworkV2 -> TestNetwork -> TestXXXNetwork
2. Initialize common Mocks in setUp() to reduce redundant code.
3. Introduce class FakeNetwork to fake one or more networks, just like FakeServer.
This BP is connected to BP [1]. If we don't refactor the unit tests of network, the implementation of network commands won't go well.
[1] https:/
Blueprint information
- Status:
- Complete
- Approver:
- Tang Chen
- Priority:
- Medium
- Drafter:
- Tang Chen
- Direction:
- Approved
- Assignee:
- Tang Chen
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Implemented
- Milestone target:
- None
- Started by
- Richard Theis
- Completed by
- Richard Theis
Related branches
Related bugs
Sprints
Whiteboard
(rtheis): Hi Tang, is this blueprint completed?
(tangchen): Yes, this is completed. Thanks for reminding me, Richard.:)
Gerrit topic: https:/
Addressed by: https:/
Refactor network test: Introduce TestNetworkv2 and TestNetwork to improve unit test of network.
Addressed by: https:/
Refactor TestCreateNetwork: Split TestCreateNetwork into two classes for identity v2 and v3.
Addressed by: https:/
Refactor TestCreateNetwork: Setup cmd in setUp() in TestCreateNetwo
Addressed by: https:/
Refactor TestCreateNetwork: Setup cmd in setUp() in TestCreateNetwo
Addressed by: https:/
Refactor TestCreateNetwork: Setup identity client in setUp() in TestCreateNetwo
Addressed by: https:/
Refactor TestCreateNetwork: Setup identity client in setUp() in TestCreateNetwo
Addressed by: https:/
Refactor TestDeleteNetwork: Use TestNetwork in TestDeleteNetwork.
Addressed by: https:/
Refactor TestListNetwork: Use TestNetwork in TestListNetwork
Addressed by: https:/
Refactor TestSetNetwork: Use TestNetwork in TestSetNetwork
Addressed by: https:/
Refactor TestShowNetwork: Use TestNetwork in TestShowNetwork
Addressed by: https:/
Refactor network test: Remove unusful test code.
Addressed by: https:/
SDK integration: Add a temporary method to create network client using sdk.
Addressed by: https:/
Introduce class FakeNetwork to fake one or more networks.
Addressed by: https:/
Migrate "network list" command to new version using SDK.
Addressed by: https:/
Migrate "network create" command to use SDK.
Addressed by: https:/
Migrate "network delete" command to use SDK.
Addressed by: https:/
Migrate "network set" command to use SDK.
Addressed by: https:/
Migrate "network show" command to use SDK.
Addressed by: https:/
Migrate network client to SDK.
Addressed by: https:/
Remove unuseful test data in test_netwrok.py