# 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/job.py
# class Job(Model):
#     class Meta:
#         list_url = "/apis/batch/v1/jobs"
#         url_template = "/apis/batch/v1/namespaces/{namespace}/jobs"
# 
#     metadata = Field(ObjectMeta)
#     spec = Field(JobSpec)
# 
# class JobSpec(Model):
#     template = Field(PodTemplateSpec)
#     backoffLimit = Field(int)
#     activeDeadlineSeconds = Field(int)
#     completions = Field(int)
#     manualSelector = Field(bool)
#     parallelism = Field(int)
#     selector = Field(LabelSelector)
# 
# 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.job import Job, JobSpec
from k8s.models.pod import Container, LocalObjectReference, PodTemplateSpec, PodSpec
    )
    image_pull_secret = LocalObjectReference(name="image_pull_secret")
    pod_spec = PodSpec(containers=[container], imagePullSecrets=[image_pull_secret], serviceAccountName="default",
                       restartPolicy="Never")
    pod_template_spec = PodTemplateSpec(metadata=object_meta, spec=pod_spec)
    job_spec = JobSpec(template=pod_template_spec)
    job = Job(metadata=object_meta, spec=job_spec)

    return job


def _create_mock_response():
    mock_response = mock.Mock()
    mock_response.json.return_value = {
        u"metadata": {
            u"labels": {
                u"test": u"true"
            },
            u"namespace": u"my-namespace",
            u"name": u"my-name"
        },
        u"spec": {
            u"template": {
                u"spec": {
                    u"serviceAccountName": u"default",
                    u"restartPolicy": u"Never",
                    u"volumes": [],
                    u"imagePullSecrets": [
                        {
                            u"name": u"image_pull_secret"

# 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/job.py
# class Job(Model):
#     class Meta:
#         list_url = "/apis/batch/v1/jobs"
#         url_template = "/apis/batch/v1/namespaces/{namespace}/jobs"
# 
#     metadata = Field(ObjectMeta)
#     spec = Field(JobSpec)
# 
# class JobSpec(Model):
#     template = Field(PodTemplateSpec)
#     backoffLimit = Field(int)
#     activeDeadlineSeconds = Field(int)
#     completions = Field(int)
#     manualSelector = Field(bool)
#     parallelism = Field(int)
#     selector = Field(LabelSelector)
# 
# 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_job.py
import mock
import pytest
from k8s.client import NotFound
from k8s.models.common import ObjectMeta
from k8s.models.job import Job, JobSpec
from k8s.models.pod import Container, LocalObjectReference, PodTemplateSpec, PodSpec

    )
    image_pull_secret = LocalObjectReference(name="image_pull_secret")
    pod_spec = PodSpec(containers=[container], imagePullSecrets=[image_pull_secret], serviceAccountName="default",
                       restartPolicy="Never")
    pod_template_spec = PodTemplateSpec(metadata=object_meta, spec=pod_spec)
    job_spec = JobSpec(template=pod_template_spec)
    job = Job(metadata=object_meta, spec=job_spec)

    return job


def _create_mock_response():
    mock_response = mock.Mock()
    mock_response.json.return_value = {
        u"metadata": {
            u"labels": {
                u"test": u"true"
            },
            u"namespace": u"my-namespace",
            u"name": u"my-name"
        },
        u"spec": {
            u"template": {
                u"spec": {
                    u"serviceAccountName": u"default",
                    u"restartPolicy": u"Never",
                    u"volumes": [],
                    u"imagePullSecrets": [
                        {
                            u"name": u"image_pull_secret"

                        }