# 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/role.py
# class Role(Model):
#     class Meta:
#         list_url = "/apis/rbac.authorization.k8s.io/v1/roles"
#         url_template = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}"
# 
#     metadata = Field(ObjectMeta)
#     rules = ListField(PolicyRule)
# 
# class PolicyRule(Model):
#     apiGroups = ListField(six.text_type)
#     resources = ListField(six.text_type)
#     verbs = ListField(six.text_type)
#     resourceNames = ListField(six.text_type)
#     nonResourceURLs = ListField(six.text_type)


import mock
import pytest
from k8s.client import NotFound
from k8s.models.common import ObjectMeta
from k8s.models.role import Role, PolicyRule
                "test": "true"
            },
            "name": NAME,
            "namespace": NAMESPACE,
            "resourceVersion": "42",
            "selfLink": _uri(NAMESPACE, NAME),
            "uid": "d8f1ba26-b182-11e6-a364-fa163ea2a9c4"
        },
        "rules": [
            {
                "apiGroups": ["fiaas.schibsted.io"],
                "resources": ["applications", "application-statuses"],
                "verbs": ["get", "list", "watch"],
            },
        ],
    }
    return mock_response


def _create_default_role():
    object_meta = ObjectMeta(name=NAME, namespace=NAMESPACE, labels={"test": "true"})
    policy_rules = [
        PolicyRule(
            apiGroups=["fiaas.schibsted.io"],
            resources=["applications", "application-statuses"],
            verbs=["get", "list", "watch"],
            resourceNames=[],
            nonResourceURLs=[],
        )
    ]

# 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/role.py
# class Role(Model):
#     class Meta:
#         list_url = "/apis/rbac.authorization.k8s.io/v1/roles"
#         url_template = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}"
# 
#     metadata = Field(ObjectMeta)
#     rules = ListField(PolicyRule)
# 
# class PolicyRule(Model):
#     apiGroups = ListField(six.text_type)
#     resources = ListField(six.text_type)
#     verbs = ListField(six.text_type)
#     resourceNames = ListField(six.text_type)
#     nonResourceURLs = ListField(six.text_type)


# Path: tests/k8s/test_role.py
import mock
import pytest
from k8s.client import NotFound
from k8s.models.common import ObjectMeta
from k8s.models.role import Role, PolicyRule

                "test": "true"
            },
            "name": NAME,
            "namespace": NAMESPACE,
            "resourceVersion": "42",
            "selfLink": _uri(NAMESPACE, NAME),
            "uid": "d8f1ba26-b182-11e6-a364-fa163ea2a9c4"
        },
        "rules": [
            {
                "apiGroups": ["fiaas.schibsted.io"],
                "resources": ["applications", "application-statuses"],
                "verbs": ["get", "list", "watch"],
            },
        ],
    }
    return mock_response


def _create_default_role():
    object_meta = ObjectMeta(name=NAME, namespace=NAMESPACE, labels={"test": "true"})
    policy_rules = [
        PolicyRule(
            apiGroups=["fiaas.schibsted.io"],
            resources=["applications", "application-statuses"],
            verbs=["get", "list", "watch"],
            resourceNames=[],
            nonResourceURLs=[],
        )
    ]

    return Role(metadata=object_meta, rules=policy_rules)