More tweaks, trying to get tests to be clean.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2024-01-10 11:18:33 -05:00
parent 908d695b54
commit ac9591ec7c
18 changed files with 37 additions and 29 deletions

View File

@@ -120,7 +120,7 @@ def test_get_template_with_non_existent_template_id_returns_404(
}
@pytest.mark.parametrize("tmp_type", list(TemplateType))
@pytest.mark.parametrize("tmp_type", TemplateType)
def test_get_template_with_non_existent_version_returns_404(
client, sample_service, tmp_type
):

View File

@@ -59,7 +59,7 @@ valid_post = [
]
@pytest.mark.parametrize("tmp_type", list(TemplateType))
@pytest.mark.parametrize("tmp_type", TemplateType)
@pytest.mark.parametrize(
"subject,content,post_data,expected_subject,expected_content,expected_html",
valid_post,
@@ -125,7 +125,7 @@ def test_email_templates_not_rendered_into_content(client, sample_service):
assert resp_json["body"] == template.content
@pytest.mark.parametrize("tmp_type", list(TemplateType))
@pytest.mark.parametrize("tmp_type", TemplateType)
def test_invalid_post_template_returns_400(client, sample_service, tmp_type):
template = create_template(
sample_service,

View File

@@ -114,7 +114,7 @@ def test_get_template_request_schema_against_invalid_args_is_invalid(
assert error["message"] in error_message
@pytest.mark.parametrize("template_type", list(TemplateType))
@pytest.mark.parametrize("template_type", TemplateType)
@pytest.mark.parametrize(
"response", [valid_json_get_response, valid_json_get_response_with_optionals]
)
@@ -149,7 +149,7 @@ def test_post_template_preview_against_invalid_args_is_invalid(args, error_messa
assert error["message"] in error_messages
@pytest.mark.parametrize("template_type", list(TemplateType))
@pytest.mark.parametrize("template_type", TemplateType)
@pytest.mark.parametrize(
"response", [valid_json_post_response, valid_json_post_response_with_optionals]
)

View File

@@ -41,7 +41,7 @@ def test_get_all_templates_returns_200(client, sample_service):
assert template["subject"] == templates[index].subject
@pytest.mark.parametrize("tmp_type", list(TemplateType))
@pytest.mark.parametrize("tmp_type", TemplateType)
def test_get_all_templates_for_valid_type_returns_200(client, sample_service, tmp_type):
templates = [
create_template(
@@ -75,7 +75,7 @@ def test_get_all_templates_for_valid_type_returns_200(client, sample_service, tm
assert template["subject"] == templates[index].subject
@pytest.mark.parametrize("tmp_type", list(TemplateType))
@pytest.mark.parametrize("tmp_type", TemplateType)
def test_get_correct_num_templates_for_valid_type_returns_200(
client, sample_service, tmp_type
):

View File

@@ -256,19 +256,19 @@ invalid_json_get_all_response = [
]
@pytest.mark.parametrize("template_type", list(TemplateType))
@pytest.mark.parametrize("template_type", TemplateType)
def test_get_all_template_request_schema_against_no_args_is_valid(template_type):
data = {}
assert validate(data, get_all_template_request) == data
@pytest.mark.parametrize("template_type", list(TemplateType))
@pytest.mark.parametrize("template_type", TemplateType)
def test_get_all_template_request_schema_against_valid_args_is_valid(template_type):
data = {"type": template_type}
assert validate(data, get_all_template_request) == data
@pytest.mark.parametrize("template_type", list(TemplateType))
@pytest.mark.parametrize("template_type", TemplateType)
def test_get_all_template_request_schema_against_invalid_args_is_invalid(template_type):
data = {"type": "unknown"}