# Path: k8s/base.py
# LOG = logging.getLogger(__name__)
#     ADDED = "ADDED"
#     MODIFIED = "MODIFIED"
#     DELETED = "DELETED"
# class MetaModel(type):
# class ApiMixIn(object):
# class Model(six.with_metaclass(MetaModel)):
# class WatchEvent(object):
# class LabelSelector(object):
# class Equality(LabelSelector):
# class Inequality(LabelSelector):
# class LabelSetSelector(LabelSelector):
# class In(LabelSetSelector):
# class NotIn(LabelSetSelector):
# class Exists(LabelSelector):
# class SelfModel:
#     def __new__(mcs, cls, bases, attrs):
#     def _build_url(cls, **kwargs):
#     def find(cls, name="", namespace="default", labels=None):
#     def list(cls, namespace="default"):
#     def watch_list(cls, namespace=None):
#     def get(cls, name, namespace="default"):
#     def get_or_create(cls, **kwargs):
#     def delete(cls, name, namespace="default", **kwargs):
#     def delete_list(cls, namespace="default", labels=None, delete_options=None, **kwargs):
#     def save(self):
#     def _label_selector(labels):
#     def __init__(self, new=True, **kwargs):
#     def _validate_fields(self):
#     def as_dict(self):
#     def merge(self, other):
#     def update_from_dict(self, d):
#     def from_dict(cls, d):
#     def __repr__(self):
#     def __eq__(self, other):
# def _api_name(name):
#     def __init__(self, event_json, cls):
#     def __repr__(self):
#     def __init__(self, value=""):
#     def __str__(self):
#     def __str__(self):
#     def __init__(self):
#     def __str__(self):
# 
# Path: k8s/models/common.py
# class DeleteOptions(Model):
#     apiVersion = Field(six.text_type)
#     dryRun = ListField(six.text_type)
#     gracePeriodSeconds = Field(int)
#     kind = Field(six.text_type)
#     preconditions = Field(Preconditions)
#     propagationPolicy = Field(six.text_type)
# 
# class Preconditions(Model):
#     resourceVersion = Field(six.text_type)
#     uid = Field(six.text_type)


import mock
import pytest
from k8s.base import Model, Field, WatchEvent, Equality, Inequality, In, NotIn, Exists
from k8s.models.common import DeleteOptions, Preconditions
        labels = [
            ("foo", Inequality("bar")),
            ("foo", Exists())
        ]
        Example.find(labels=labels)

        expected_selector = "foo!=bar,foo"

        client.get.assert_called_once_with("/example", params={"labelSelector": expected_selector})


class TestDeleteList(object):

    @pytest.fixture
    def client(self):
        with mock.patch.object(Example, "_client") as m:
            yield m

    def test_delete_list(self, client):
        Example.delete_list(labels={"foo": Equality("bar"), "cat": Inequality("dog")})

        client.delete.assert_called_once_with("/example", body=None, params={"labelSelector": "cat!=dog,foo=bar"})

    def test_delete_with_options(self, client):
        opts = DeleteOptions(
            apiVersion="foo/v1",
            dryRun=[],
            gracePeriodSeconds=30,
            preconditions=Preconditions(uid="1234", resourceVersion="12"),
            propagationPolicy="Foreground"

# Path: k8s/base.py
# LOG = logging.getLogger(__name__)
#     ADDED = "ADDED"
#     MODIFIED = "MODIFIED"
#     DELETED = "DELETED"
# class MetaModel(type):
# class ApiMixIn(object):
# class Model(six.with_metaclass(MetaModel)):
# class WatchEvent(object):
# class LabelSelector(object):
# class Equality(LabelSelector):
# class Inequality(LabelSelector):
# class LabelSetSelector(LabelSelector):
# class In(LabelSetSelector):
# class NotIn(LabelSetSelector):
# class Exists(LabelSelector):
# class SelfModel:
#     def __new__(mcs, cls, bases, attrs):
#     def _build_url(cls, **kwargs):
#     def find(cls, name="", namespace="default", labels=None):
#     def list(cls, namespace="default"):
#     def watch_list(cls, namespace=None):
#     def get(cls, name, namespace="default"):
#     def get_or_create(cls, **kwargs):
#     def delete(cls, name, namespace="default", **kwargs):
#     def delete_list(cls, namespace="default", labels=None, delete_options=None, **kwargs):
#     def save(self):
#     def _label_selector(labels):
#     def __init__(self, new=True, **kwargs):
#     def _validate_fields(self):
#     def as_dict(self):
#     def merge(self, other):
#     def update_from_dict(self, d):
#     def from_dict(cls, d):
#     def __repr__(self):
#     def __eq__(self, other):
# def _api_name(name):
#     def __init__(self, event_json, cls):
#     def __repr__(self):
#     def __init__(self, value=""):
#     def __str__(self):
#     def __str__(self):
#     def __init__(self):
#     def __str__(self):
# 
# Path: k8s/models/common.py
# class DeleteOptions(Model):
#     apiVersion = Field(six.text_type)
#     dryRun = ListField(six.text_type)
#     gracePeriodSeconds = Field(int)
#     kind = Field(six.text_type)
#     preconditions = Field(Preconditions)
#     propagationPolicy = Field(six.text_type)
# 
# class Preconditions(Model):
#     resourceVersion = Field(six.text_type)
#     uid = Field(six.text_type)


# Path: tests/k8s/test_base.py
import mock
import pytest
from k8s.base import Model, Field, WatchEvent, Equality, Inequality, In, NotIn, Exists
from k8s.models.common import DeleteOptions, Preconditions

        labels = [
            ("foo", Inequality("bar")),
            ("foo", Exists())
        ]
        Example.find(labels=labels)

        expected_selector = "foo!=bar,foo"

        client.get.assert_called_once_with("/example", params={"labelSelector": expected_selector})


class TestDeleteList(object):

    @pytest.fixture
    def client(self):
        with mock.patch.object(Example, "_client") as m:
            yield m

    def test_delete_list(self, client):
        Example.delete_list(labels={"foo": Equality("bar"), "cat": Inequality("dog")})

        client.delete.assert_called_once_with("/example", body=None, params={"labelSelector": "cat!=dog,foo=bar"})

    def test_delete_with_options(self, client):
        opts = DeleteOptions(
            apiVersion="foo/v1",
            dryRun=[],
            gracePeriodSeconds=30,
            preconditions=Preconditions(uid="1234", resourceVersion="12"),
            propagationPolicy="Foreground"

        )