make inventory maps proxy items and containers propxy inventories

This commit is contained in:
evilchili
2024-09-02 14:02:16 -07:00
parent b09b07d172
commit d9b3c4500e
3 changed files with 100 additions and 78 deletions
+5 -5
View File
@@ -165,11 +165,11 @@ def test_containers(db, carl):
db.add_or_update([carl, ten_foot_pole, bag_of_holding])
# add the ten_foot_pole to the bag of holding
assert bag_of_holding.inventory.add(ten_foot_pole)
assert bag_of_holding.add(ten_foot_pole)
db.add_or_update(bag_of_holding)
pole_from_bag = bag_of_holding.inventory.get(ten_foot_pole)
assert pole_from_bag
assert pole_from_bag in bag_of_holding.inventory
pole_from_bag = bag_of_holding.get(ten_foot_pole)
assert pole_from_bag.item == ten_foot_pole
assert pole_from_bag in bag_of_holding
assert pole_from_bag not in carl.equipment
# add the bag of holding to carl's equipment
@@ -183,4 +183,4 @@ def test_containers(db, carl):
assert carls_pole == pole_from_bag
# remove the pole from the bag
assert carls_bag.item.inventory.remove(pole_from_bag)
assert carls_bag.remove(pole_from_bag)