# Path: k8s/client.py
# class NotFound(K8sClientException):
#     """The resource was not found, and the operation could not be completed"""
# 
# Path: k8s/models/common.py
# class ObjectMeta(Model):
#     annotations = Field(dict)
#     creationTimestamp = ReadOnlyField(datetime.datetime)
#     deletionGracePeriodSeconds = ReadOnlyField(int)
#     deletionTimestamp = ReadOnlyField(datetime.datetime)
#     finalizers = ListField(six.text_type)
#     generateName = Field(six.text_type)
#     generation = ReadOnlyField(int)
#     labels = Field(dict)
#     name = Field(six.text_type)
#     namespace = Field(six.text_type, "default")
#     ownerReferences = ListField(OwnerReference)
#     resourceVersion = ReadOnlyField(six.text_type)
#     selfLink = ReadOnlyField(six.text_type)
#     uid = ReadOnlyField(six.text_type)
# 
# Path: k8s/models/pod.py
# class ContainerPort(Model):
# class ObjectFieldSelector(Model):
# class ResourceFieldSelector(Model):
# class ConfigMapKeySelector(Model):
# class SecretKeySelector(Model):
# class EnvVarSource(Model):
# class SecretEnvSource(Model):
# class ConfigMapEnvSource(Model):
# class EnvFromSource(Model):
# class EnvVar(Model):
# class ResourceRequirements(Model):
# class VolumeMount(Model):
# class HTTPHeader(Model):
# class HTTPGetAction(Model):
# class TCPSocketAction(Model):
# class ExecAction(Model):
# class Probe(Model):
# class Handler(Model):
# class Lifecycle(Model):
# class Container(Model):
# class SecretVolumeSource(Model):
# class KeyToPath(Model):
# class ConfigMapVolumeSource(Model):
# class EmptyDirVolumeSource(Model):
# class NFSVolumeSource(Model):
# class HostPathVolumeSource(Model):
# class GCEPersistentDiskVolumeSource(Model):
# class AWSElasticBlockStoreVolumeSource(Model):
# class Volume(Model):
# class PodSpec(Model):
# class PodTemplateSpec(Model):
# class Pod(Model):
#     class Meta:


import mock
import pytest
from k8s.client import NotFound
from k8s.models.common import ObjectMeta
from k8s.models.pod import Pod, ContainerPort, Container, LocalObjectReference, PodSpec, Volume, VolumeMount, \
    SecretVolumeSource
                    }}, {
                    'name': 'default-token-0g73b',
                    'secret': {
                        'defaultMode': 420,
                        'secretName': 'default-token-0g73b'
                    }}]
            },
            'status': {
                'conditions': [{
                    'lastProbeTime': None,
                    'lastTransitionTime': '2017-10-03T10:36:20Z',
                    'status': 'True',
                    'type': 'PodScheduled'
                }],
                'phase': 'Pending',
                'qosClass': 'BestEffort'
            }
        }
        get.return_value = mock_response
        pod = Pod.get(name=NAME, namespace=NAMESPACE)
        assert not pod._new
        assert pod.metadata.name == NAME
        assert pod.spec.containers[0].ports[0].name == "http5000"
        call_params = pod.as_dict()
        put.return_value.json.return_value = call_params

        pod.save()
        pytest.helpers.assert_any_call(put, POD_URI + NAME, call_params)

    def test_pod_deleted(self, delete):

# Path: k8s/client.py
# class NotFound(K8sClientException):
#     """The resource was not found, and the operation could not be completed"""
# 
# Path: k8s/models/common.py
# class ObjectMeta(Model):
#     annotations = Field(dict)
#     creationTimestamp = ReadOnlyField(datetime.datetime)
#     deletionGracePeriodSeconds = ReadOnlyField(int)
#     deletionTimestamp = ReadOnlyField(datetime.datetime)
#     finalizers = ListField(six.text_type)
#     generateName = Field(six.text_type)
#     generation = ReadOnlyField(int)
#     labels = Field(dict)
#     name = Field(six.text_type)
#     namespace = Field(six.text_type, "default")
#     ownerReferences = ListField(OwnerReference)
#     resourceVersion = ReadOnlyField(six.text_type)
#     selfLink = ReadOnlyField(six.text_type)
#     uid = ReadOnlyField(six.text_type)
# 
# Path: k8s/models/pod.py
# class ContainerPort(Model):
# class ObjectFieldSelector(Model):
# class ResourceFieldSelector(Model):
# class ConfigMapKeySelector(Model):
# class SecretKeySelector(Model):
# class EnvVarSource(Model):
# class SecretEnvSource(Model):
# class ConfigMapEnvSource(Model):
# class EnvFromSource(Model):
# class EnvVar(Model):
# class ResourceRequirements(Model):
# class VolumeMount(Model):
# class HTTPHeader(Model):
# class HTTPGetAction(Model):
# class TCPSocketAction(Model):
# class ExecAction(Model):
# class Probe(Model):
# class Handler(Model):
# class Lifecycle(Model):
# class Container(Model):
# class SecretVolumeSource(Model):
# class KeyToPath(Model):
# class ConfigMapVolumeSource(Model):
# class EmptyDirVolumeSource(Model):
# class NFSVolumeSource(Model):
# class HostPathVolumeSource(Model):
# class GCEPersistentDiskVolumeSource(Model):
# class AWSElasticBlockStoreVolumeSource(Model):
# class Volume(Model):
# class PodSpec(Model):
# class PodTemplateSpec(Model):
# class Pod(Model):
#     class Meta:


# Path: tests/k8s/test_pod.py
import mock
import pytest
from k8s.client import NotFound
from k8s.models.common import ObjectMeta
from k8s.models.pod import Pod, ContainerPort, Container, LocalObjectReference, PodSpec, Volume, VolumeMount, \
    SecretVolumeSource

                    }}, {
                    'name': 'default-token-0g73b',
                    'secret': {
                        'defaultMode': 420,
                        'secretName': 'default-token-0g73b'
                    }}]
            },
            'status': {
                'conditions': [{
                    'lastProbeTime': None,
                    'lastTransitionTime': '2017-10-03T10:36:20Z',
                    'status': 'True',
                    'type': 'PodScheduled'
                }],
                'phase': 'Pending',
                'qosClass': 'BestEffort'
            }
        }
        get.return_value = mock_response
        pod = Pod.get(name=NAME, namespace=NAMESPACE)
        assert not pod._new
        assert pod.metadata.name == NAME
        assert pod.spec.containers[0].ports[0].name == "http5000"
        call_params = pod.as_dict()
        put.return_value.json.return_value = call_params

        pod.save()
        pytest.helpers.assert_any_call(put, POD_URI + NAME, call_params)

    def test_pod_deleted(self, delete):

        Pod.delete(NAME, NAMESPACE)