separate cli and gui application in own python packages. provide database schema as python package.

This commit is contained in:
Thomas Peetz
2025-01-19 23:36:52 +01:00
parent f07c7b74ee
commit ada723dc48
113 changed files with 1224 additions and 1223 deletions
@@ -0,0 +1,36 @@
from pytest import raises
from kontor.main import KontorCliTest
def test_kontor():
# test kontor without any subcommands or arguments
with KontorCliTest() as app:
app.run()
assert app.exit_code == 0
def test_kontor_debug():
# test that debug mode is functional
argv = ['--debug']
with KontorCliTest(argv=argv) as app:
app.run()
assert app.debug is True
def test_command1():
# test command1 without arguments
argv = ['command1']
with KontorCliTest(argv=argv) as app:
app.run()
data,output = app.last_rendered
assert data['foo'] == 'bar'
assert output.find('Foo => bar')
# test command1 with arguments
argv = ['command1', '--foo', 'not-bar']
with KontorCliTest(argv=argv) as app:
app.run()
data,output = app.last_rendered
assert data['foo'] == 'not-bar'
assert output.find('Foo => not-bar')