def test_import_content_win(mocker):
    mocker.patch("looker_deployer.commands.deploy_content.get_gzr_creds")
    deploy_content.get_gzr_creds.return_value = ("foobar.com", "1234", "abc", "xyz", "True")

    mocker.patch("os.name", "nt")

    mocker.patch("subprocess.run")
    deploy_content.import_content("dashboard", "tacocat.json", "42", "env", "ini", False)
    subprocess.run.assert_called_with([
        "cmd.exe",
        "/c",
        "gzr",
        "dashboard",
        "import",
        "tacocat.json",
        "42",
        "--host",
        "foobar.com",
        "--port",
        "1234",
        "--client-id",
        "abc",
        "--client-secret",
        "xyz",
        "--force"
    ])
Exemplo n.º 2
0
def test_import_content_no_verify_ssl(mocker):
    mocker.patch("looker_deployer.commands.deploy_content.get_gzr_creds")
    deploy_content.get_gzr_creds.return_value = ("foobar.com", "abc", "xyz",
                                                 "False")

    mocker.patch("subprocess.run")
    deploy_content.import_content("dashboard", "tacocat.json", "42", "env",
                                  "ini")
    subprocess.run.assert_called_with([
        "gzr", "dashboard", "import", "tacocat.json", "42", "--host",
        "foobar.com", "--client-id", "abc", "--client-secret", "xyz",
        "--force", "--no-verify-ssl"
    ])