From b14a8980b81c50f16fb5a8accf9ee4c61901cb47 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 21 Dec 2023 14:13:27 -0800 Subject: [PATCH] add more info for unit tests --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 43d6ee0a..bcfc3c3d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,6 +20,8 @@ Pull requests are the best way to propose changes to the codebase (we use [Githu - Local development: You can even place a new parser python module file in the [parser plugin directory](https://github.com/kellyjonbrazil/jc#parser-plugins) to get started right away with just a standard `jc` installation. - Parser registry: Add the parser name to the [jc/lib.py](https://github.com/kellyjonbrazil/jc/blob/master/jc/lib.py) file. 4. If you've added code that should be tested, add tests. All new parsers should have several sample outputs and tests. + - Templates: Use the [tests/templates/_test_foo.py](https://github.com/kellyjonbrazil/jc/blob/master/tests/templates/_test_foo.py) or [tests/templates/_test_foo_s.py (streaming)](https://github.com/kellyjonbrazil/jc/tree/master/tests/templates) files as a template + - Fixtures: Tests typically consist of an input file and an expected output JSON file. Add the data files to the appropriate folder under [tests/fixtures](https://github.com/kellyjonbrazil/jc/tree/master/tests/fixtures) 5. Documentation is auto-generated from docstrings, so ensure they are clear and accurate. 6. Ensure the test suite passes. (Note: "**America/Los_Angeles**" timezone should be configured on the test system) 7. Make sure your code lints.