Skip to content

Commit

Permalink
adjusted tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian321 committed Dec 14, 2024
1 parent 385247c commit b5b4f80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ss14_tiled/generate/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def merge_entity(child: dict, parent: dict) -> dict:
"""Merge entities."""
out = copy.deepcopy(parent)
for (key, value) in child.items():
if key == "components" or key == "parent":
if key in ("components", "parent"):
continue
out[key] = value

Expand Down
10 changes: 6 additions & 4 deletions ss14_tiled/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_basalt(self):
child = {
"type": "entity",
"id": "BasaltTwo",
"parent": "BasaltOne",
"parent": ["BasaltOne"],
"placement": {
"mode": "SnapgridCenter"
},
Expand All @@ -29,6 +29,7 @@ def test_basalt(self):
parent = {
"type": "entity",
"id": "BasaltOne",
"parent": [],
"description": "Rock.",
"placement": {
"mode": "SnapgridCenter"
Expand Down Expand Up @@ -57,7 +58,7 @@ def test_basalt(self):
expected = {
"type": "entity",
"id": "BasaltTwo",
"parent": "BasaltOne",
"parent": ["BasaltOne"],
"description": "Rock.",
"placement": {
"mode": "SnapgridCenter"
Expand Down Expand Up @@ -91,20 +92,21 @@ def test_new_component(self):
"""If the child has a new component."""
child = {
"id": "B",
"parent": "A",
"parent": ["A"],
"components": [{
"type": "test_2"
}]
}
parent = {
"id": "A",
"parent": [],
"components": [{
"type": "test_1"
}]
}
expected = {
"id": "B",
"parent": "A",
"parent": ["A"],
"components": [{
"type": "test_1"
}, {
Expand Down

0 comments on commit b5b4f80

Please sign in to comment.