def test_missing_namespace_file(self, getter):
     os.environ[CONTAINER_NAME] = "container_name"
     found_resources = get_gke_resources()
     self.assertEqual(
         found_resources,
         {
             "cloud.account.id": "project_id",
             "k8s.cluster.name": "cluster_name",
             "k8s.namespace.name": "",
             "host.id": "instance_id",
             "k8s.pod.name": "",
             "container.name": "container_name",
             "cloud.zone": "zone",
             "cloud.provider": "gcp",
             "gcp.resource_type": "gke_container",
         },
     )
 def test_finding_gke_resources(self, getter):
     os.environ[NAMESPACE] = "namespace"
     os.environ[CONTAINER_NAME] = "container_name"
     os.environ[HOSTNAME] = "host_name"
     found_resources = get_gke_resources()
     self.assertEqual(getter.call_args_list[0][0][0], _GCP_METADATA_URL)
     self.assertEqual(
         found_resources,
         {
             "cloud.account.id": "project_id",
             "k8s.cluster.name": "cluster_name",
             "k8s.namespace.name": "namespace",
             "host.id": "instance_id",
             "k8s.pod.name": "host_name",
             "container.name": "container_name",
             "cloud.zone": "zone",
             "cloud.provider": "gcp",
             "gcp.resource_type": "gke_container",
         },
     )
 def test_missing_container_name(self, getter):
     pop_environ_key(CONTAINER_NAME)
     self.assertEqual(get_gke_resources(), {})