Пример #1
0
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"]
Пример #2
0
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
Пример #3
0
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
Пример #4
0
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