Log (debug) when done autoconfiguring components
authorKarl O. Pinc <kop@karlpinc.com>
Sun, 13 Sep 2020 00:20:50 +0000 (19:20 -0500)
committerKarl O. Pinc <kop@karlpinc.com>
Sun, 13 Sep 2020 00:20:50 +0000 (19:20 -0500)
src/pgwui_server/__init__.py
tests/test___init__.py

index 2db01be924476d4dc7f2b58b84494a83939b1bf1..eb3b7c39c90beec63ef4735a66d49a577012daf9 100644 (file)
@@ -182,6 +182,7 @@ def apply_component_defaults(settings, components):
             log.debug('Autoconfiguring PGWUI component: {}'.format(component))
             config.include(component)
         add_routes(config, settings)
+    log.debug('Done autoconfiguring PGWUI components')
     return config
 
 
index 95ad04c9b164d86494ec50528e37144322ad33a4..9b86c3910fd2fa9835f69a66d2d5d19ae8a1801d 100644 (file)
@@ -482,10 +482,11 @@ def test_apply_component_defaults(monkeypatch, caplog,
 
     logs = caplog.record_tuples
 
-    assert len(logs) == 1
+    assert len(logs) == 2  # One for the single autoconfig, one for finishing
 
-    level = logs[0][1]
-    assert level == logging.DEBUG
+    for log in logs:
+        level = log[1]
+        assert level == logging.DEBUG
 
 
 mock_apply_component_defaults = testing.make_mock_fixture(