From: Karl O. Pinc Date: Mon, 11 Mar 2024 16:40:16 +0000 (-0500) Subject: Simplify the includeme() testing X-Git-Url: https://papio.biology.duke.edu/gitweb/?a=commitdiff_plain;h=520aae458a65de2bb3aa4fef64277a6e2799b868;p=pgwui_develop Simplify the includeme() testing --- 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()