Use a temporary file for testing defaults.ini content loading in test_pypi_sourcecode_analyzer.py
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 210
- Forks
- 36
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 2
Description
Description
In this test module - https://github.com/oracle/macaron/blob/612e27ec347e7e073311b65a32b9eec8c6ba7d5c/tests/malware_analyzer/pypi/test_pypi_sourcecode_analyzer.py, we are mocking the defaults object to test some behaviors relating to some source code analysis configuration in defaults.ini.
Expectation
In this module https://github.com/oracle/macaron/blob/44dbf0acbd3dcb9f577db97b5c6876cfb8c87957/tests/config/test_defaults.py we put the defaults.ini content into a temporary file and load from it.
This is an example https://github.com/oracle/macaron/blob/44dbf0acbd3dcb9f577db97b5c6876cfb8c87957/tests/config/test_defaults.py#L103-L109
which can remove the need for mocking and keep the defaults.ini in the test definition itself. Perhaps we can rewrite the tests in test_pypi_sourcecode_analyzer.py to use this approach instead.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.