Skip to content

Commit

Permalink
use TestCase class for data dictionary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
damonmcc committed Sep 18, 2024
1 parent 6f7f4d8 commit b498749
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions dcpy/test/lifecycle/package/test_generate_data_dictionary.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()

0 comments on commit b498749

Please sign in to comment.