Exemplo n.º 1
0
def test_main(input_command, tmpdir):
    with tmp_chdir(str(tmpdir)):
        output = subprocess.check_output(
            input_command, stderr=subprocess.STDOUT).decode("utf-8")
    assert "pyproj version:" in output
    assert "PROJ version:" in output
    assert "-v, --verbose  Show verbose debugging version information." in output
Exemplo n.º 2
0
def test_main__verbose(input_command, option, tmpdir):
    with tmp_chdir(str(tmpdir)):
        output = subprocess.check_output(
            input_command + [option], stderr=subprocess.STDOUT).decode("utf-8")
    assert "pyproj:" in output
    assert "PROJ:" in output
    assert "data dir" in output
    assert "user_data_dir" in output
    assert "System" in output
    assert "python" in output
    assert "Python deps" in output
    assert "-v, --verbose " not in output
Exemplo n.º 3
0
def test_sync__source_id__list(input_command, tmpdir):
    with tmp_chdir(str(tmpdir)):
        output = subprocess.check_output(
            input_command + [
                "sync",
                "--source-id",
                "fr_ign",
                "--list-files",
                "--include-already-downloaded",
            ],
            stderr=subprocess.STDOUT,
        ).decode("utf-8")
    lines = output.strip().split("\n")
    assert len(lines) > 2
    _check_list_files_header(lines)
    for line in lines[2:]:
        assert "fr_ign" == line.split("|")[1].strip()
Exemplo n.º 4
0
def test_sync__area_of_use__list(input_command, tmpdir):
    with tmp_chdir(str(tmpdir)):
        output = subprocess.check_output(
            input_command + [
                "sync",
                "--area-of-use",
                "France",
                "--list-files",
                "--include-already-downloaded",
            ],
            stderr=subprocess.STDOUT,
        ).decode("utf-8")
    lines = output.strip().split("\n")
    assert len(lines) > 2
    _check_list_files_header(lines)
    for line in lines[2:]:
        assert "France" in line.split("|")[-1]
Exemplo n.º 5
0
def test_sync__bbox__list(input_command, tmpdir):
    with tmp_chdir(str(tmpdir)):
        output = subprocess.check_output(
            input_command + [
                "sync",
                "--bbox",
                "2,49,3,50",
                "--list-files",
                "--include-already-downloaded",
            ],
            stderr=subprocess.STDOUT,
        ).decode("utf-8")
    lines = output.strip().split("\n")
    assert len(lines) > 2
    _check_list_files_header(lines)
    assert " | be_ign | " in output
    assert " | us_nga | " in output
    assert " | fr_ign | " in output
Exemplo n.º 6
0
def test_sync(input_command, option, tmpdir):
    with tmp_chdir(str(tmpdir)):
        output = subprocess.check_output(
            input_command + ["sync"] + option, stderr=subprocess.STDOUT
        ).decode("utf-8")
    assert (
        "Tool for synchronizing PROJ datum and transformation support data." in output
    )
    assert "--bbox" in output
    assert "--spatial-test" in output
    assert "--source-id" in output
    assert "--area-of-use" in output
    assert "--file" in output
    assert "--exclude-world-coverage" in output
    assert "--include-already-downloaded" in output
    assert "--list-files" in output
    assert "--system-directory" in output
    assert "--target-directory" in output
    assert "-v, --verbose" in output
Exemplo n.º 7
0
def test_sync__all__exclusive_error(input_command, extra_arg, tmpdir):
    with tmp_chdir(str(tmpdir)), pytest.raises(subprocess.CalledProcessError):
        subprocess.check_output(
            input_command + ["sync", "--all", extra_arg], stderr=subprocess.STDOUT
        )