Changeset 276 for trunk/game/tests


Ignore:
Timestamp:
09/07/09 20:59:20 (10 years ago)
Author:
orlandov
Message:

Ticket #67: Refactor unit tests into runnable shape

  • Move tests to their own top level directory
  • Fix unit test failures
  • Add base/composed classes to test suite
  • Run like "nosetests ./run_python.py" OR "./run_python.py"
Location:
trunk/game/tests
Files:
2 added
2 moved

Legend:

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

    r275 r276  
     1#!/usr/bin/python 
     2 
    13import unittest 
    24from scripts.objects.containers import WoodenCrate 
     
    1012        self.assertEqual(self.crate.ID, 'crate01') 
    1113        self.assertEqual(self.crate.name, 'Wooden Crate') 
    12         self.assertEqual(self.crate.text, 'A battered down crate') 
    13         self.assertEqual(self.crate.gfx, \ 
    14                 {'map': 'objects/objects/crate/image.png'}) 
     14        self.assertEqual(self.crate.text, 'A battered crate') 
     15        self.assertEqual(self.crate.gfx, 'crate') 
    1516        self.assertEqual(self.crate.coords, (0.0, 0.0)) 
    1617        self.assertEqual(self.crate.map_id, None) 
     
    2425 
    2526    # can't test containing functionality...there are no containable objects 
    26     
     27 
    2728    def test_lockable(self): 
    2829        self.crate2.lock() 
     
    3031        self.crate2.unlock() 
    3132        self.assertEqual(self.crate2.locked, False) 
    32  
    33 if __name__=='__main__': 
    34     unittest.main() 
Note: See TracChangeset for help on using the changeset viewer.