Ignore:
Timestamp:
12/14/09 07:48:48 (10 years ago)
Author:
b0rland_parpg
Message:

Ticket #107: patch by b0rland

  • Added bulk and capacity into Carryable and Containers
  • Slightly improved weight property
  • Replaced ValueError? with domain-specific exceptions
  • Added bulk limits processing into InventoryGUI
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/tests/test_container.py

    r424 r449  
    6565        self.assertEqual(self.item.in_container, container) 
    6666        self.assertEqual(container.count(), 1) 
     67        self.assertRaises(Container.SlotBusy, container.placeItem, self.item2, 0) 
    6768        self.assertRaises(ValueError, container.takeItem, self.item2) 
    6869        container.takeItem(self.item) 
    6970        self.assertEqual(container.items, {}) 
    7071        self.assertEqual(container.count(), 0) 
     72 
     73    def testBulk(self): 
     74        container = self.NonScriptableContainer(5, capacity=15) 
     75        self.item.bulk=10 
     76        self.item2.bulk=7 
     77        container.placeItem(self.item) 
     78        self.assertRaises(Container.TooBig, container.placeItem, self.item2) 
    7179 
    7280    def testScripting(self): 
Note: See TracChangeset for help on using the changeset viewer.