From 1ecddbeaf50050f4d6f0fd562d665001c9cb2880 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Mon, 30 Nov 2020 20:47:20 -0600 Subject: [PATCH] Mark unit tests --- tests/test_check_settings.py | 8 ++++++++ tests/test_pgwui_upload.py | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/tests/test_check_settings.py b/tests/test_check_settings.py index d6aac1d..3833fd0 100644 --- a/tests/test_check_settings.py +++ b/tests/test_check_settings.py @@ -19,6 +19,8 @@ # Karl O. Pinc +import pytest + import pgwui_upload.check_settings as check_settings from pgwui_common import checkset @@ -53,6 +55,7 @@ mock_boolean_settings = testing.make_mock_fixture( # validate_literal_column_headings() +@pytest.mark.unittest def test_validate_literal_column_headings_nosetting(): '''No error is delivered when there's no setting''' errors = [] @@ -61,6 +64,7 @@ def test_validate_literal_column_headings_nosetting(): assert errors == [] +@pytest.mark.unittest def test_validate_literal_column_headings_on(): '''No error is delivered when the setting is "on"''' errors = [] @@ -70,6 +74,7 @@ def test_validate_literal_column_headings_on(): assert errors == [] +@pytest.mark.unittest def test_validate_literal_column_headings_off(): '''No error is delivered when the setting is "off"''' errors = [] @@ -79,6 +84,7 @@ def test_validate_literal_column_headings_off(): assert errors == [] +@pytest.mark.unittest def test_validate_literal_column_headings_ask(): '''No error is delivered when the setting is "ask"''' errors = [] @@ -88,6 +94,7 @@ def test_validate_literal_column_headings_ask(): assert errors == [] +@pytest.mark.unittest def test_validate_literal_column_headings_bad(): '''delivers an error when given a bad value''' errors = [] @@ -107,6 +114,7 @@ mock_validate_literal_column_headings = testing.make_mock_fixture( # check_settings() +@pytest.mark.unittest def test_check_settings(mock_unknown_settings, mock_require_settings, mock_boolean_settings, diff --git a/tests/test_pgwui_upload.py b/tests/test_pgwui_upload.py index 131a5d3..5309dbe 100644 --- a/tests/test_pgwui_upload.py +++ b/tests/test_pgwui_upload.py @@ -19,6 +19,7 @@ # Karl O. Pinc +import pytest import pyramid.testing import pgwui_upload.pgwui_upload as pgwui_upload @@ -39,6 +40,7 @@ def test_pgwui_upload_is_pgwui_component(pgwui_component_entry_point): # init_menu() +@pytest.mark.unittest def test_init_menu_default(): '''The settings get the module's default value when no settings exist ''' @@ -51,6 +53,7 @@ def test_init_menu_default(): == pgwui_upload.DEFAULT_UPLOAD_MENU_LABEL +@pytest.mark.unittest def test_init_menu_no_default(): '''The settings keep their value when they exist ''' @@ -80,6 +83,7 @@ mock_add_route = testing.instance_method_mock_fixture('add_route') mock_scan = testing.instance_method_mock_fixture('scan') +@pytest.mark.unittest def test_includeme(mock_init_menu, mock_add_route, mock_scan): '''init_menu, add_route, and scan are all called ''' -- 2.34.1