Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions marathon/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __repr__(self):
def __eq__(self, other):
try:
return self.__dict__ == other.__dict__
except:
except Exception:
return False

def __hash__(self):
Expand Down Expand Up @@ -68,7 +68,7 @@ def __repr__(self):
def __eq__(self, other):
try:
return self.__dict__ == other.__dict__
except:
except Exception:
return False

def __hash__(self):
Expand Down
4 changes: 2 additions & 2 deletions marathon/models/group.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .base import MarathonResource, assert_valid_id
from .base import MarathonResource
from .app import MarathonApp


Expand Down Expand Up @@ -36,5 +36,5 @@ def __init__(self, apps=None, dependencies=None,
# p if isinstance(p, MarathonPod) else MarathonPod().from_json(p)
# for p in (pods or [])
# ]
self.id = assert_valid_id(id)
self.id = id
self.version = version
19 changes: 19 additions & 0 deletions tests/test_model_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# encoding: utf-8

from marathon.models.group import MarathonGroup
import unittest


class MarathonGroupTest(unittest.TestCase):

def test_from_json_parses_root_group(self):
data = {
"id": "/",
"groups": [
{"id": "/foo", "apps": []},
{"id": "/bla", "apps": []},
],
"apps": []
}
group = MarathonGroup().from_json(data)
self.assertEqual("/", group.id)