From 520aae458a65de2bb3aa4fef64277a6e2799b868 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Mon, 11 Mar 2024 11:40:16 -0500 Subject: [PATCH] Simplify the includeme() testing --- .../TEMPLATE/tests/test_pgwui_TEMPLATE.py.mak | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/pgwui_develop/TEMPLATE/tests/test_pgwui_TEMPLATE.py.mak b/src/pgwui_develop/TEMPLATE/tests/test_pgwui_TEMPLATE.py.mak index 84ae794..2537242 100644 --- a/src/pgwui_develop/TEMPLATE/tests/test_pgwui_TEMPLATE.py.mak +++ b/src/pgwui_develop/TEMPLATE/tests/test_pgwui_TEMPLATE.py.mak @@ -81,20 +81,15 @@ mock_establish_settings = testing.make_mock_fixture( # includeme() -mock_add_route = testing.instance_method_mock_fixture('add_route') -mock_scan = testing.instance_method_mock_fixture('scan') - +mock_testConfig = testing.make_mock_fixture(pyramid.testing.testConfig) @pytest.mark.unittest -def test_includeme(mock_establish_settings, mock_add_route, mock_scan): +def test_includeme(mock__settings, mock_testConfig): '''establish_settings, add_route, and scan are all called ''' - with pyramid.testing.testConfig() as config: - mocked_add_route = mock_add_route(config) - mocked_scan = mock_scan(config) - + with mock_testConfig() as config: ${component.lower()}.includeme(config) + config.establish_settings.assert_called_once() + config.add_route.assert_called_once() + config.scan.assert_called_once() - mock_establish_settings.assert_called_once() - mocked_add_route.assert_called_once() - mocked_scan.assert_called_once() -- 2.34.1