2024-02-28 13:28:03 -08:00
|
|
|
import unittest
|
2024-03-14 17:29:31 -07:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
sys.path.append(os.getcwd())
|
2024-02-28 13:28:03 -08:00
|
|
|
from tests import utils_for_test as test_utils
|
2024-03-14 17:29:31 -07:00
|
|
|
sys.path.pop()
|
2024-02-28 13:28:03 -08:00
|
|
|
|
|
|
|
# Execute these steps for standard tests:
|
|
|
|
# - Save this file as `test_{parser_name}.py` since the helper methods extract parser names from the filename.
|
|
|
|
# - Organize fixtures in `tests/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_needsrestart_nodata(self):
|
|
|
|
"""
|
|
|
|
Test 'needsrestart' with no data
|
|
|
|
"""
|
|
|
|
test_utils.run_no_data(self, __file__, {})
|
|
|
|
|
|
|
|
def test_needsrestart_all_fixtures(self):
|
|
|
|
"""
|
|
|
|
Test 'needsrestart' with various fixtures
|
|
|
|
"""
|
|
|
|
test_utils.run_all_fixtures(self, __file__)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|