code: def test_ensure_non_null_project(monkeypatch):
      # test case where GOOGLE_CLOUD_PROJECT is already set
      env = {"foo": "bar", "GOOGLE_CLOUD_PROJECT": "project"}
  
      new_env = caliban_launcher._ensure_non_null_project(env)
      assert env == new_env
  
      # GOOGLE_CLOUD_PROJECT not set, but valid project from default()
      def mock_default(
          scopes=None, request=None, quota_project_id=None
      ):
          return (credentials.AnonymousCredentials(), "foo")
  
      monkeypatch.setattr("google.auth.default", mock_default)
      env = {"foo": "bar"}
      assert caliban_launcher._ensure_non_null_project(env) == env
  
      # GOOGLE_CLOUD_PROJECT not set, no valid project from default()
      def mock_default(
          scopes=None, request=None, quota_project_id=None
      ):
          return (credentials.AnonymousCredentials(), None)
  
      monkeypatch.setattr("google.auth.default", mock_default)
      env = {"foo": "bar"}
      new_env = caliban_launcher._ensure_non_null_project(env)
      for k, v in env.items():
          assert new_env.get(k) == v
  
      assert new_env.get("GOOGLE_CLOUD_PROJECT") is not None
  
file_path: caliban/tests/caliban/resources/test_caliban_launcher.py
imports: import argparse
  import builtins
  from google.auth import credentials
  import json
  import os
  import pytest
  import tempfile
  from typing import Any
  from caliban.resources import caliban_launcher
label_desc: Use image node_id 6 for calling a global function with example usage: test_ensure_non_null_project(monkeypatch) and returns: credentials,  str, credentials,  None