def test_valid_driver_mode(): base_path = cli.base_path() storage_path = cli.storage_path() args = cli.args().parse_args(['--source-dir', '/foo/bar']) config = cli.config(args) assert cli.driver_mode(config) == ["--host", "--port", "8080", "--bind-address", "0.0.0.0", "--script", "{}/scripts/flasked.py /foo/bar {}".format(base_path, storage_path), "--quiet"]
def test_valid_driver_mode(): base_path = cli.base_path() storage_path = cli.storage_path() args = cli.args().parse_args(['--source-dir', '/foo/bar']) config = cli.config(args) expected = [ "--host", "--port", "8080", "--bind-address", "0.0.0.0", "--script", "{}/scripts/flasked.py".format(base_path) + " /foo/bar {} 0.0.0.0 8080".format(storage_path), "--quiet" ] assert cli.driver_mode(config) == expected
def test_valid_driver_mode_config_file(): base_path = cli.base_path() storage_path = cli.storage_path() args = cli.args().parse_args(['--config', 'test/fixtures/simple.toml']) config = cli.config(args) expected = [ "--host", "--port", "8080", "--bind-address", "0.0.0.0", "--script", "{}/scripts/flasked.py".format(base_path) + " ./test/records {} 0.0.0.0 8080".format(storage_path), "--quiet" ] assert cli.driver_mode(config) == expected
def test_valid_driver_mode_config_file(): base_path = cli.base_path() storage_path = cli.storage_path() args = cli.args().parse_args(['--config', 'test/fixtures/simple.toml']) config = cli.config(args) expected = [ "--host", "--port", "8080", "--bind-address", "0.0.0.0", "--script", "{}/scripts/flasked.py".format(base_path) + " ./test/records {} 0.0.0.0 8080".format(storage_path), "--quiet"] assert cli.driver_mode(config) == expected
def test_unexpected_flags_driver_mode(): args = cli.args().parse_args(['--url', 'http://localhost']) config = cli.config(args) assert type(cli.driver_mode(config)) == Exception