From 8af22f7963c9f93fe0e395aac4391bf7bb639f2b Mon Sep 17 00:00:00 2001 From: Gavin Peters Date: Wed, 25 Dec 2024 15:12:09 -0500 Subject: [PATCH] Add test for creating items with position. It seems the entity creation interface has a really surprising nonuniformity here. There's likely a need to chase this further with all objects, but for now this at least documents one problem. TEST=TestEntity.test_create_with_position --- test/test_entity.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_entity.py b/test/test_entity.py index bf4fd56..752a17e 100644 --- a/test/test_entity.py +++ b/test/test_entity.py @@ -87,6 +87,13 @@ def test_suggest_similar_name(self): ): Container("wodenchest") + def test_create_with_position(self): + iron_chest = new_entity('iron-chest', tile_position=(3,3)) + assert iron_chest.position.x == 3.5 and iron_chest.position.y == 3.5 + + active_provider_chest = new_entity('active-provider-chest', tile_position=(10,10)) + assert active_provider_chest.position.x == 10.5 and active_provider_chest.position.y == 10.5 + def test_set_position(self): iron_chest = Container("iron-chest") iron_chest.position = (1.23, 1.34)