include LICENSE.txt
include Makefile
include src/pgwui_sql/VERSION
+include src/pgwui_sql/static/*.css
include src/pgwui_sql/templates/*.mak
include tox.ini
'''Pyramid configuration for PGWUI_SQL
'''
establish_settings(config)
+ config.add_static_view(
+ f'static/{PGWUI_COMPONENT}',
+ f'{PGWUI_COMPONENT}:static/',
+ cache_max_age=3600)
config.add_route(PGWUI_COMPONENT, DEFAULT_SQL_ROUTE)
config.scan()
--- /dev/null
+/* Copyright (C) 2024 The Meme Factory, Inc. http://www.karlpinc.com/
+ *
+ * This file is part of PGWUI_Common.
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Required style sheet for PGWUI programs.
+ *
+ * Karl O. Pinc <kop@karlpinc.com>
+ */
+
+/* The SQL entry window. */
+.sqltext { height: 40em;
+ width: 80em; }
+
content="PostgreSQL Web User Interface, Interactive SQL execution" />
</%block>
+<%block name="stylesheet_links">
+ ${parent.stylesheet_links()}
+ <link rel="stylesheet"
+ href="${request.static_url('pgwui_sql:static/pgwui_sql.css')}"
+ type="text/css" />
+</%block>
+
<%block name="action_success">
<p><em class="success">Executed SQL without errors</em>,
from a file<em class="success">!</em>
# includeme()
+mock_add_static_view = testing.late_instance_mock_fixture('add_static_view')
mock_add_route = testing.late_instance_mock_fixture('add_route')
mock_scan = testing.late_instance_mock_fixture('scan')
@pytest.mark.unittest
-def test_includeme(mock_establish_settings, mock_add_route, mock_scan):
+def test_includeme(mock_establish_settings, mock_add_static_view,
+ mock_add_route, mock_scan):
'''establish_settings, add_route, and scan are all called
'''
with pyramid.testing.testConfig() as config:
+ mocked_add_static_view = mock_add_static_view(config)
mocked_add_route = mock_add_route(config)
mocked_scan = mock_scan(config)
pgwui_sql.includeme(config)
mock_establish_settings.assert_called_once()
+ mocked_add_static_view.assert_called_once()
mocked_add_route.assert_called_once()
mocked_scan.assert_called_once()