Changeset 439 for trunk/game/tests


Ignore:
Timestamp:
12/08/09 08:20:30 (10 years ago)
Author:
b0rland_parpg
Message:

Ticket #229: patch by b0rland
Added findItem function which currently allows searching by name and kind inside inventory and container

File:
1 edited

Legend:

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

    r436 r439  
    2727 
    2828    def setUp(self): 
    29         self.item = self.CarryableObject(12) 
     29        self.item = self.CarryableObject(12, name="TestItem1") 
    3030        self.item.weight = 12 
    3131        self.item2 = self.CarryableObject(13) 
     
    7474        self.assertEqual(self.inventory.findItemByID(12), self.item) 
    7575        self.assertEqual(self.inventory.findItemByID(13), None) 
     76        self.assertEqual(self.inventory.findItem(name="TestItem1"), self.item) 
     77        self.assertEqual(self.inventory.findItem(name="RandomName1"), None) 
     78        self.assertEqual(self.inventory.findItem(kind="carryable"), self.item) 
     79        self.assertEqual(self.inventory.findItem(kind="weapon"), None) 
    7680 
    7781         
Note: See TracChangeset for help on using the changeset viewer.