1#!/usr/bin/env python3
 2
 3"""Test a selection of command line tools.
 4
 5All tests must be generic across all projects.
 6
 7The tool() fixture knows the current application name. It also checks for
 8bad exit codes (and text to stderr?).
 9
10We should include some collections like PUS tests also.
11"""
12
13import pytest
14
15# skipif(test, reason)
16
17@pytest.mark.xfail
18def test_settings(tool):
19    """Test the `settings` tool runs."""
20    if tool is None:
21        # I think this never happens and the fixture itself skips if no
22        # project is used
23        pytest.skip('No project launcher configured')
24
25    tool('settings -l')
26    tool('settings appname')
27
28@pytest.mark.xfail
29def test_ddl_sys(tool):
30    """Test the DDL tool can generate a system table."""
31    tool('ddl --sys-table events')
32
33@pytest.mark.xfail
34def test_ddl_list_databases(tool):
35    """Test the `ddl` tool can make a system table."""
36    tool('ddl --sys-table JOBS')
37
38@pytest.mark.xfail
39def test_schedule(tool):
40    """Perform a basic test that the schedule and activity XML files make sense."""
41    tool('scheduler --show-schedule')