# 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/networking_v1_ingress.py
# class Ingress(Model):
#     class Meta:
#         list_url = "/apis/networking.k8s.io/v1/ingresses"
#         url_template = "/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}"
#         watch_list_url = "/apis/networking.k8s.io/v1/ingresses?watch=true"
# 
#     metadata = Field(ObjectMeta)
#     spec = Field(IngressSpec)
#     status = Field(IngressStatus)
# 
# class IngressSpec(Model):
#     defaultBackend = Field(IngressBackend)
#     ingressClassName = Field(six.text_type)
#     rules = ListField(IngressRule)
#     tls = ListField(IngressTLS)
# 
# class IngressRule(Model):
#     host = Field(six.text_type)
#     http = Field(HTTPIngressRuleValue)
# 
# class IngressBackend(Model):
#     resource = Field(TypedLocalObjectReference)
#     service = Field(IngressServiceBackend)
# 
# class HTTPIngressPath(Model):
#     backend = Field(IngressBackend)
#     path = Field(six.text_type)
#     pathType = Field(six.text_type)
# 
# class HTTPIngressRuleValue(Model):
#     paths = ListField(HTTPIngressPath)
# 
# class IngressServiceBackend(Model):
#     name = Field(six.text_type)
#     port = Field(ServiceBackendPort)
# 
# class ServiceBackendPort(Model):
#     name = Field(six.text_type)
#     number = Field(int)


import mock
import pytest
from k8s.client import NotFound
from k8s.models.common import ObjectMeta
from k8s.models.networking_v1_ingress import Ingress, IngressSpec, IngressRule, IngressBackend, HTTPIngressPath, \
    HTTPIngressRuleValue, IngressServiceBackend, ServiceBackendPort
                        'paths': [
                            {
                                'path': '/',
                                'backend': {
                                    'service': {
                                        'name': 'dummy',
                                        'port': {
                                            'name': 'http',
                                        }
                                    }
                                }
                            }
                        ]
                    }
                }
            ]
        },
        "status": {
            "loadBalancer": {}
        }
    }
    return mock_response


def _create_default_ingress():
    object_meta = ObjectMeta(name=NAME, namespace=NAMESPACE, labels={"test": "true"})
    ingress_backend = IngressBackend(IngressServiceBackend(name="dummy", port=ServiceBackendPort(name="http")))
    http_ingress_path = HTTPIngressPath(path="/", backend=ingress_backend)
    http_ingress_rule = HTTPIngressRuleValue(paths=[http_ingress_path])
    ingress_rule = IngressRule(host="dummy.example.com", http=http_ingress_rule)

# 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/networking_v1_ingress.py
# class Ingress(Model):
#     class Meta:
#         list_url = "/apis/networking.k8s.io/v1/ingresses"
#         url_template = "/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}"
#         watch_list_url = "/apis/networking.k8s.io/v1/ingresses?watch=true"
# 
#     metadata = Field(ObjectMeta)
#     spec = Field(IngressSpec)
#     status = Field(IngressStatus)
# 
# class IngressSpec(Model):
#     defaultBackend = Field(IngressBackend)
#     ingressClassName = Field(six.text_type)
#     rules = ListField(IngressRule)
#     tls = ListField(IngressTLS)
# 
# class IngressRule(Model):
#     host = Field(six.text_type)
#     http = Field(HTTPIngressRuleValue)
# 
# class IngressBackend(Model):
#     resource = Field(TypedLocalObjectReference)
#     service = Field(IngressServiceBackend)
# 
# class HTTPIngressPath(Model):
#     backend = Field(IngressBackend)
#     path = Field(six.text_type)
#     pathType = Field(six.text_type)
# 
# class HTTPIngressRuleValue(Model):
#     paths = ListField(HTTPIngressPath)
# 
# class IngressServiceBackend(Model):
#     name = Field(six.text_type)
#     port = Field(ServiceBackendPort)
# 
# class ServiceBackendPort(Model):
#     name = Field(six.text_type)
#     number = Field(int)


# Path: tests/k8s/test_networking_v1_ingress.py
import mock
import pytest
from k8s.client import NotFound
from k8s.models.common import ObjectMeta
from k8s.models.networking_v1_ingress import Ingress, IngressSpec, IngressRule, IngressBackend, HTTPIngressPath, \
    HTTPIngressRuleValue, IngressServiceBackend, ServiceBackendPort

                        'paths': [
                            {
                                'path': '/',
                                'backend': {
                                    'service': {
                                        'name': 'dummy',
                                        'port': {
                                            'name': 'http',
                                        }
                                    }
                                }
                            }
                        ]
                    }
                }
            ]
        },
        "status": {
            "loadBalancer": {}
        }
    }
    return mock_response


def _create_default_ingress():
    object_meta = ObjectMeta(name=NAME, namespace=NAMESPACE, labels={"test": "true"})
    ingress_backend = IngressBackend(IngressServiceBackend(name="dummy", port=ServiceBackendPort(name="http")))
    http_ingress_path = HTTPIngressPath(path="/", backend=ingress_backend)
    http_ingress_rule = HTTPIngressRuleValue(paths=[http_ingress_path])
    ingress_rule = IngressRule(host="dummy.example.com", http=http_ingress_rule)

    ingress_spec = IngressSpec(rules=[ingress_rule])