1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00
Files
jc/tests/templates/_test_foo_simple.py
Muescha 962632ac1f Feature: generic fixtures tests (#529)
* add generic test runners

* extract generic test runners

* beautify messages, remove unused return value

* add template and info do CONTRIBUTING

* typo

---------

Co-authored-by: Kelly Brazil <kellyjonbrazil@gmail.com>
2024-02-06 01:54:31 +00:00

29 lines
893 B
Python

import unittest
from tests import utils_for_test as test_utils
# Execute these steps for standard tests:
# - Save this file as `text_{parser_name}.py` since the helper methods extract parser names from the filename.
# - Organize fixtures in `text/fixtures` for optimal structure.
# - Format fixtures as follows (using double dashes):
# - `{parser_name}--{some_test_description}.out` for command output.
# - `{parser_name}--{some_test_description}.json` for expected JSON after parsing.
class MyTests(unittest.TestCase):
def test_path_nodata(self):
"""
Test 'my_parser_name' with no data
"""
test_utils.run_no_data(self, __file__, {})
def test_all_fixtures(self):
"""
Test 'my_parser_name' with various fixtures
"""
test_utils.run_all_fixtures(self, __file__)
if __name__ == '__main__':
unittest.main()