# Path: marathon/models/app.py
# class MarathonApp(MarathonResource):
# class MarathonHealthCheck(MarathonObject):
# class MarathonTaskFailure(MarathonObject):
# class MarathonUpgradeStrategy(MarathonObject):
# class MarathonUnreachableStrategy(MarathonObject):
# class MarathonAppVersionInfo(MarathonObject):
# class MarathonTaskStats(MarathonObject):
# class MarathonTaskStatsType(MarathonObject):
# class MarathonTaskStatsStats(MarathonObject):
# class MarathonTaskStatsCounts(MarathonObject):
# class MarathonTaskStatsLifeTime(MarathonObject):
# class ReadinessCheck(MarathonObject):
# class PortDefinition(MarathonObject):
# class Residency(MarathonObject):
# class Secret(MarathonObject):
#     UPDATE_OK_ATTRIBUTES = [
#         'args', 'backoff_factor', 'backoff_seconds', 'cmd', 'constraints', 'container', 'cpus', 'dependencies', 'disk',
#         'env', 'executor', 'gpus', 'health_checks', 'instances', 'kill_selection', 'labels', 'max_launch_delay_seconds',
#         'mem', 'ports', 'require_ports', 'store_urls', 'task_rate_limit', 'upgrade_strategy', 'unreachable_strategy',
#         'uris', 'user', 'version', 'role'
#     ]
#     CREATE_ONLY_ATTRIBUTES = ['id', 'accepted_resource_roles']
#     READ_ONLY_ATTRIBUTES = [
#         'deployments', 'tasks', 'tasks_running', 'tasks_staged', 'tasks_healthy', 'tasks_unhealthy']
#     KILL_SELECTIONS = ["YOUNGEST_FIRST", "OLDEST_FIRST"]
#     DISABLED = 'disabled'
#     def __init__(self, accepted_resource_roles=None, args=None, backoff_factor=None, backoff_seconds=None, cmd=None,
#                  constraints=None, container=None, cpus=None, dependencies=None, deployments=None, disk=None, env=None,
#                  executor=None, health_checks=None, id=None, role=None, instances=None, kill_selection=None, labels=None,
#                  last_task_failure=None, max_launch_delay_seconds=None, mem=None, ports=None, require_ports=None,
#                  store_urls=None, task_rate_limit=None, tasks=None, tasks_running=None, tasks_staged=None,
#                  tasks_healthy=None, task_kill_grace_period_seconds=None, tasks_unhealthy=None, upgrade_strategy=None,
#                  unreachable_strategy=None, uris=None, user=None, version=None, version_info=None,
#                  ip_address=None, fetch=None, task_stats=None, readiness_checks=None,
#                  readiness_check_results=None, secrets=None, port_definitions=None, residency=None, gpus=None, networks=None):
#     def add_env(self, key, value):
#     def __init__(self, command=None, grace_period_seconds=None, interval_seconds=None, max_consecutive_failures=None,
#                  path=None, port_index=None, protocol=None, timeout_seconds=None, ignore_http1xx=None, **kwargs):
#     def __init__(self, app_id=None, host=None, message=None, task_id=None, instance_id=None,
#                  slave_id=None, state=None, timestamp=None, version=None):
#     def __init__(self, maximum_over_capacity=None,
#                  minimum_health_capacity=None):
#     def __init__(self, unreachable_inactive_after_seconds=None,
#                  unreachable_expunge_after_seconds=None,
#                  inactive_after_seconds=None, expunge_after_seconds=None):
#     def from_json(cls, attributes):
#     def __init__(self, last_scaling_at=None, last_config_change_at=None):
#     def __init__(self, started_after_last_scaling=None,
#                  with_latest_config=None, with_outdated_config=None, total_summary=None):
#     def __init__(self, stats=None):
#     def __init__(self, counts=None, life_time=None):
#     def __init__(self, staged=None,
#                  running=None, healthy=None, unhealthy=None):
#     def __init__(self, average_seconds=None, median_seconds=None):
#     def __init__(self, name=None, protocol=None, path=None, port_name=None, interval_seconds=None,
#                  http_status_codes_for_ready=None, preserve_last_response=None, timeout_seconds=None):
#     def __init__(self, port=None, protocol=None, name=None, labels=None):
#     def __init__(self, relaunch_escalation_timeout_seconds=None, task_lost_behavior=None):
#     def __init__(self, source=None):


from marathon.models.app import MarathonConstraint
import unittest

class MarathonConstraintTests(unittest.TestCase):
    def test_repr_with_value(self):
        constraint = MarathonConstraint('a_field', 'OPERATOR', 'a_value')
        representation = repr(constraint)
        self.assertEqual(representation,
                         "MarathonConstraint::a_field:OPERATOR:a_value")

    def test_repr_without_value(self):
        constraint = MarathonConstraint('a_field', 'OPERATOR')
        representation = repr(constraint)
        self.assertEqual(representation,
                         "MarathonConstraint::a_field:OPERATOR")

    def test_json_repr_with_value(self):
        constraint = MarathonConstraint('a_field', 'OPERATOR', 'a_value')
        json_repr = constraint.json_repr()
        self.assertEqual(json_repr, ['a_field', 'OPERATOR', 'a_value'])

    def test_json_repr_without_value(self):
        constraint = MarathonConstraint('a_field', 'OPERATOR')
        json_repr = constraint.json_repr()
        self.assertEqual(json_repr, ['a_field', 'OPERATOR'])

    def test_from_json_with_value(self):
        constraint = MarathonConstraint.from_json(['a_field', 'OPERATOR', 'a_value'])
        self.assertEqual(constraint,
                         MarathonConstraint('a_field', 'OPERATOR', 'a_value'))

    def test_from_json_without_value(self):

# Path: marathon/models/app.py
# class MarathonApp(MarathonResource):
# class MarathonHealthCheck(MarathonObject):
# class MarathonTaskFailure(MarathonObject):
# class MarathonUpgradeStrategy(MarathonObject):
# class MarathonUnreachableStrategy(MarathonObject):
# class MarathonAppVersionInfo(MarathonObject):
# class MarathonTaskStats(MarathonObject):
# class MarathonTaskStatsType(MarathonObject):
# class MarathonTaskStatsStats(MarathonObject):
# class MarathonTaskStatsCounts(MarathonObject):
# class MarathonTaskStatsLifeTime(MarathonObject):
# class ReadinessCheck(MarathonObject):
# class PortDefinition(MarathonObject):
# class Residency(MarathonObject):
# class Secret(MarathonObject):
#     UPDATE_OK_ATTRIBUTES = [
#         'args', 'backoff_factor', 'backoff_seconds', 'cmd', 'constraints', 'container', 'cpus', 'dependencies', 'disk',
#         'env', 'executor', 'gpus', 'health_checks', 'instances', 'kill_selection', 'labels', 'max_launch_delay_seconds',
#         'mem', 'ports', 'require_ports', 'store_urls', 'task_rate_limit', 'upgrade_strategy', 'unreachable_strategy',
#         'uris', 'user', 'version', 'role'
#     ]
#     CREATE_ONLY_ATTRIBUTES = ['id', 'accepted_resource_roles']
#     READ_ONLY_ATTRIBUTES = [
#         'deployments', 'tasks', 'tasks_running', 'tasks_staged', 'tasks_healthy', 'tasks_unhealthy']
#     KILL_SELECTIONS = ["YOUNGEST_FIRST", "OLDEST_FIRST"]
#     DISABLED = 'disabled'
#     def __init__(self, accepted_resource_roles=None, args=None, backoff_factor=None, backoff_seconds=None, cmd=None,
#                  constraints=None, container=None, cpus=None, dependencies=None, deployments=None, disk=None, env=None,
#                  executor=None, health_checks=None, id=None, role=None, instances=None, kill_selection=None, labels=None,
#                  last_task_failure=None, max_launch_delay_seconds=None, mem=None, ports=None, require_ports=None,
#                  store_urls=None, task_rate_limit=None, tasks=None, tasks_running=None, tasks_staged=None,
#                  tasks_healthy=None, task_kill_grace_period_seconds=None, tasks_unhealthy=None, upgrade_strategy=None,
#                  unreachable_strategy=None, uris=None, user=None, version=None, version_info=None,
#                  ip_address=None, fetch=None, task_stats=None, readiness_checks=None,
#                  readiness_check_results=None, secrets=None, port_definitions=None, residency=None, gpus=None, networks=None):
#     def add_env(self, key, value):
#     def __init__(self, command=None, grace_period_seconds=None, interval_seconds=None, max_consecutive_failures=None,
#                  path=None, port_index=None, protocol=None, timeout_seconds=None, ignore_http1xx=None, **kwargs):
#     def __init__(self, app_id=None, host=None, message=None, task_id=None, instance_id=None,
#                  slave_id=None, state=None, timestamp=None, version=None):
#     def __init__(self, maximum_over_capacity=None,
#                  minimum_health_capacity=None):
#     def __init__(self, unreachable_inactive_after_seconds=None,
#                  unreachable_expunge_after_seconds=None,
#                  inactive_after_seconds=None, expunge_after_seconds=None):
#     def from_json(cls, attributes):
#     def __init__(self, last_scaling_at=None, last_config_change_at=None):
#     def __init__(self, started_after_last_scaling=None,
#                  with_latest_config=None, with_outdated_config=None, total_summary=None):
#     def __init__(self, stats=None):
#     def __init__(self, counts=None, life_time=None):
#     def __init__(self, staged=None,
#                  running=None, healthy=None, unhealthy=None):
#     def __init__(self, average_seconds=None, median_seconds=None):
#     def __init__(self, name=None, protocol=None, path=None, port_name=None, interval_seconds=None,
#                  http_status_codes_for_ready=None, preserve_last_response=None, timeout_seconds=None):
#     def __init__(self, port=None, protocol=None, name=None, labels=None):
#     def __init__(self, relaunch_escalation_timeout_seconds=None, task_lost_behavior=None):
#     def __init__(self, source=None):


# Path: tests/test_model_constraint.py
from marathon.models.app import MarathonConstraint
import unittest


class MarathonConstraintTests(unittest.TestCase):
    def test_repr_with_value(self):
        constraint = MarathonConstraint('a_field', 'OPERATOR', 'a_value')
        representation = repr(constraint)
        self.assertEqual(representation,
                         "MarathonConstraint::a_field:OPERATOR:a_value")

    def test_repr_without_value(self):
        constraint = MarathonConstraint('a_field', 'OPERATOR')
        representation = repr(constraint)
        self.assertEqual(representation,
                         "MarathonConstraint::a_field:OPERATOR")

    def test_json_repr_with_value(self):
        constraint = MarathonConstraint('a_field', 'OPERATOR', 'a_value')
        json_repr = constraint.json_repr()
        self.assertEqual(json_repr, ['a_field', 'OPERATOR', 'a_value'])

    def test_json_repr_without_value(self):
        constraint = MarathonConstraint('a_field', 'OPERATOR')
        json_repr = constraint.json_repr()
        self.assertEqual(json_repr, ['a_field', 'OPERATOR'])

    def test_from_json_with_value(self):
        constraint = MarathonConstraint.from_json(['a_field', 'OPERATOR', 'a_value'])
        self.assertEqual(constraint,
                         MarathonConstraint('a_field', 'OPERATOR', 'a_value'))

    def test_from_json_without_value(self):

        constraint = MarathonConstraint.from_json(['a_field', 'OPERATOR'])