Commit Graph

2 Commits

Author SHA1 Message Date
judyjoseph
ca3e71da0a
[sonic-py-common] Relocate some functions from sonic-utilities ()
* Relocate interface related common functions to py-common
* Add unit tests for interface API's.
2020-08-30 08:24:29 -07:00
Joe LeVeque
58db2d53e3
[sonic-py-common] Add unit test framework ()
**- Why I did it**

To install the framework for adding unit tests to the sonic-py-common package and report coverage.

** How I did it **

- Incorporate pytest and pytest-cov into sonic-py-common package build
- Updgrade version of 'mock' installed to version 3.0.5, the last version which supports Python 2. This fixes a bug where the file object returned from `mock_open()` was not iterable (see https://bugs.python.org/issue32933)
- Add support for Python 3 setuptools and pytest in sonic-slave-buster environment
- Add tests for `device_info.get_machine_info()` and `device_info.get_platform()` functions
- Also add a .gitignore in the root of the sonic-py-common directory, move all related ignores from main .gitignore file, and add ignores for files and dirs generated by pytest-cov
2020-08-24 10:35:22 -07:00