Skip to content
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

Modified the tests to use mock functionality of get_child_port function under portconfig utility #1464

Merged
merged 3 commits into from
Mar 24, 2021

Conversation

samaity
Copy link
Contributor

@samaity samaity commented Feb 24, 2021

Signed-off-by: Sangita Maity [email protected]

What I did
Modified the tests to use mock functionality of get_child_port function under portconfig utility. This will remove the dependency of port config utility in the sonic-buildimage and make the test case more robust specific to the DPB cli utility.

How I did it
used MagicMock feature

How to verify it
All test cases are passed in config_dpb_test.py file


tests/config_dpb_test.py::TestConfigDPB::test_get_breakout_options PASSED [ 10%]
tests/config_dpb_test.py::TestConfigDPB::test_config_breakout_extra_table_warning PASSED [ 11%]
tests/config_dpb_test.py::TestConfigDPB::test_config_breakout_verbose PASSED [ 11%]
tests/config_dpb_test.py::TestConfigDPB::test_config_breakout_negative_cases PASSED [ 11%]
tests/config_dpb_test.py::TestConfigDPB::test_config_breakout_various_modes PASSED [ 11%]

@samaity samaity force-pushed the mock_test_child_port branch 2 times, most recently from 523cabb to 5598a1c Compare February 25, 2021 15:22
@samaity samaity force-pushed the mock_test_child_port branch 8 times, most recently from 9a77f0b to 1f7cf5c Compare March 9, 2021 21:01
…on under portconfig utility

Signed-off-by: Sangita Maity <[email protected]>
@samaity samaity marked this pull request as ready for review March 9, 2021 22:31
Signed-off-by: Sangita Maity <[email protected]>
@samaity
Copy link
Contributor Author

samaity commented Mar 22, 2021

retest this please

@samaity
Copy link
Contributor Author

samaity commented Mar 23, 2021

@jleveque -- Kindly review whenever possible. need help in merging the code. Thanks!

tests/config_dpb_test.py Outdated Show resolved Hide resolved
tests/config_dpb_test.py Outdated Show resolved Hide resolved
tests/config_dpb_test.py Outdated Show resolved Hide resolved
tests/config_dpb_test.py Outdated Show resolved Hide resolved
tests/config_dpb_test.py Outdated Show resolved Hide resolved
tests/config_dpb_test.py Outdated Show resolved Hide resolved
tests/config_dpb_test.py Outdated Show resolved Hide resolved
tests/config_dpb_test.py Outdated Show resolved Hide resolved
tests/config_dpb_test.py Outdated Show resolved Hide resolved
tests/config_dpb_test.py Outdated Show resolved Hide resolved
Signed-off-by: Sangita Maity <[email protected]>
@samaity
Copy link
Contributor Author

samaity commented Mar 24, 2021

Thanks, @jleveque !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants