コード例 #1
0
def test_env_variables_work():
    try:
        main()
    except SystemExit:
        pass
    except exceptions.DefaultCredentialsError:
        pass

    assert True
コード例 #2
0
def test_env_variables_missing_env_name():
    with pytest.raises(ValueError,
                       match="Could not find '%s' in your environment. "
                             "Please provide an environment variable with the same name." % CS_ENV_NAME):
        try:
            main()
        except SystemExit:
            pass
        except exceptions.DefaultCredentialsError:
            pass
コード例 #3
0
def test_env_variables_missing_google_service_account():
    with pytest.raises(ValueError,
                       match="Could not find '%s' in your environment. "
                             "Please provide an environment variable with the same name."
                             % CS_GOOGLE_SERVICE_ACCOUNT_PATH):
        try:
            main()
        except SystemExit:
            pass
        except exceptions.DefaultCredentialsError:
            pass