Changeset 346 for trunk/game/tests


Ignore:
Timestamp:
10/24/09 06:17:27 (10 years ago)
Author:
b0rland_parpg
Message:

Ticket #107: patch by b0rland

  • Wrote initial version of the inventory storage class
  • Added some useful utility functions into container class and its derivatives
  • Created several combined classes for carryable containers
  • Extended tests and of course made new ones
  • Renamed old Inventory class to be InventoryGUI

Note: InventoryGUI still works the old way and doesn't use Inventory

Location:
trunk/game/tests
Files:
4 added
3 edited

Legend:

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

    r317 r346  
    6060        self.assertEqual(container.items,[]) 
    6161        self.assertEqual(self.item.in_container,None) 
     62        self.assertEqual(container.count(), 0) 
    6263        container.placeItem(self.item) 
    6364        self.assertEqual(container.items,[self.item]) 
    6465        self.assertEqual(self.item.in_container, container) 
     66        self.assertEqual(container.count(), 1) 
    6567        self.assertRaises(ValueError, container.takeItem, self.item2) 
    6668        container.takeItem(self.item) 
    6769        self.assertEqual(container.items, []) 
     70        self.assertEqual(container.count(), 0) 
    6871 
    6972    def testScripting(self): 
  • trunk/game/tests/test_living.py

    r317 r346  
    2222 
    2323    def testDie(self): 
     24        """Test Living mixin die ability""" 
    2425        creature = Living(); 
    2526        self.assertTrue(creature.is_living) 
  • trunk/game/tests/test_objects_base.py

    r317 r346  
    3434                Scriptable.  __init__( self, **kwargs ) 
    3535                CharStats.   __init__( self, **kwargs ) 
    36                 Wearable.    __init__( self, **kwargs ) 
     36                Wearable.    __init__( self, "left_arm", **kwargs ) 
    3737                Usable.      __init__( self, **kwargs ) 
    3838                Weapon.      __init__( self, **kwargs ) 
Note: See TracChangeset for help on using the changeset viewer.