From b49874940b5eb26c29c8c1f5ec83697d9e4cbeaf Mon Sep 17 00:00:00 2001 From: Damon McCullough Date: Wed, 18 Sep 2024 12:02:10 -0400 Subject: [PATCH] use `TestCase` class for data dictionary tests --- .../package/test_generate_data_dictionary.py | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/dcpy/test/lifecycle/package/test_generate_data_dictionary.py b/dcpy/test/lifecycle/package/test_generate_data_dictionary.py index 4e4be79ff..8eff2f2fd 100644 --- a/dcpy/test/lifecycle/package/test_generate_data_dictionary.py +++ b/dcpy/test/lifecycle/package/test_generate_data_dictionary.py @@ -1,4 +1,5 @@ import pytest +from unittest import TestCase from dcpy.test.lifecycle.package.conftest import TEST_METADATA_YAML_PATH, TEMP_DATA_PATH from dcpy.lifecycle.package import generate_metadata_assets @@ -8,24 +9,23 @@ @pytest.mark.usefixtures("file_setup_teardown") -def test_generate_html_from_yaml(): - html_path = generate_metadata_assets.generate_html_from_yaml( - yaml_file_path=TEST_METADATA_YAML_PATH, - output_html_path=TEST_METADATA_HTML_PATH, - html_template_path=generate_metadata_assets.DEFAULT_DATA_DICTIONARY_TEMPLATE_PATH, - ) - assert html_path.exists() +class TestDataDictionary(TestCase): + def test_generate_html_from_yaml(self): + html_path = generate_metadata_assets.generate_html_from_yaml( + yaml_file_path=TEST_METADATA_YAML_PATH, + output_html_path=TEST_METADATA_HTML_PATH, + html_template_path=generate_metadata_assets.DEFAULT_DATA_DICTIONARY_TEMPLATE_PATH, + ) + assert html_path.exists() - -@pytest.mark.usefixtures("file_setup_teardown") -def test_generate_pdf_from_html(): - html_path = generate_metadata_assets.generate_html_from_yaml( - yaml_file_path=TEST_METADATA_YAML_PATH, - output_html_path=TEST_METADATA_HTML_PATH, - html_template_path=generate_metadata_assets.DEFAULT_DATA_DICTIONARY_TEMPLATE_PATH, - ) - pdf_path = generate_metadata_assets.generate_pdf_from_html( - output_html_path=html_path, - output_pdf_path=TEST_METADATA_PDF_PATH, - ) - assert pdf_path.exists() + def test_generate_pdf_from_html(self): + html_path = generate_metadata_assets.generate_html_from_yaml( + yaml_file_path=TEST_METADATA_YAML_PATH, + output_html_path=TEST_METADATA_HTML_PATH, + html_template_path=generate_metadata_assets.DEFAULT_DATA_DICTIONARY_TEMPLATE_PATH, + ) + pdf_path = generate_metadata_assets.generate_pdf_from_html( + output_html_path=html_path, + output_pdf_path=TEST_METADATA_PDF_PATH, + ) + assert pdf_path.exists()