Changeset 279 for trunk/game/tests


Ignore:
Timestamp:
09/08/09 08:32:03 (10 years ago)
Author:
b0rland_parpg
Message:

Ticket #67: Patch by b0rland

  • Moved GameObject? tests to a separate file and added more tests
  • Rewrote run_tests to automatically execute all tests from tests directory
  • Converted all tests into camelCase naming convention
Location:
trunk/game/tests
Files:
1 added
2 edited

Legend:

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

    r276 r279  
    99        self.crate2 = WoodenCrate(ID='crate02', locked=False) 
    1010 
    11     def test_creation(self): 
     11    def testCreation(self): 
    1212        self.assertEqual(self.crate.ID, 'crate01') 
    1313        self.assertEqual(self.crate.name, 'Wooden Crate') 
     
    2626    # can't test containing functionality...there are no containable objects 
    2727 
    28     def test_lockable(self): 
     28    def testLockable(self): 
    2929        self.crate2.lock() 
    3030        self.assertEqual(self.crate2.locked, True) 
  • trunk/game/tests/test_objects_base.py

    r276 r279  
    55 
    66class TestObjectsBase(unittest.TestCase): 
    7     def test_game_object(self): 
    8         test = GameObject (1, {'map':'img/test.png'}, 
    9                            1, 1, None, 'Test object', 'Description') 
    10         self.assertEqual(test.coords, (1, 1)) 
    11         self.assertEqual(test.X, 1) 
    12         self.assertEqual(test.Y, 1) 
    13         test.coords = (2,2) 
    14         self.assertEqual(test.X, 2.0) 
    15         self.assertEqual(test.Y, 2.0) 
    167 
    17     def test_wildcard(self): 
     8    def testWildcard(self): 
    189        class Wildcard (GameObject, Lockable, Container, Living, Scriptable, 
    1910                        CharStats, Wearable, Usable, Weapon, Destructable, 
Note: See TracChangeset for help on using the changeset viewer.