Ignore:
Timestamp:
09/18/09 09:08:25 (10 years ago)
Author:
b0rland_parpg
Message:

Ticket #67: patch by b0rland

  • changed default Lockable state to unlocked
  • fixed Lockable constructor logic to correctly process locked/is_open combination
  • fixed typo in Container
  • fixed tests to accomodate the above changes
  • created tests for Openable, Lockable, Container
File:
1 edited

Legend:

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

    r284 r286  
    2222    def setUp(self): 
    2323        self.crate = WoodenCrate(ID='crate01') 
    24         self.crate2 = WoodenCrate(ID='crate02', locked=False) 
     24        self.crate2 = WoodenCrate(ID='crate02', locked=True) 
    2525 
    2626    def testCreation(self): 
     
    3434        self.assertEqual(self.crate.blocking, True) 
    3535        self.assertEqual(self.crate.is_open, True) 
    36         self.assertEqual(self.crate.locked, True) 
     36        self.assertEqual(self.crate.locked, False) 
    3737        self.assertEqual(self.crate.scripts, {}) 
    3838 
    3939        self.assertEqual(self.crate2.ID, 'crate02') 
    40         self.assertEqual(self.crate2.locked, False) 
     40        self.assertEqual(self.crate2.locked, True) 
    4141 
    4242    # can't test containing functionality...there are no containable objects 
     
    4444    def testLockable(self): 
    4545        """ Test the WoodenCrate lockability""" 
    46         self.crate2.lock() 
    47         self.assertEqual(self.crate2.locked, True) 
    48         self.crate2.unlock() 
    49         self.assertEqual(self.crate2.locked, False) 
     46        self.crate.lock() 
     47        self.assertEqual(self.crate.locked, True) 
     48        self.crate.unlock() 
     49        self.assertEqual(self.crate.locked, False) 
Note: See TracChangeset for help on using the changeset viewer.