def test_env_variables_work(): try: main() except SystemExit: pass except exceptions.DefaultCredentialsError: pass assert True
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
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