You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
'''
|
|
Tests for Mech
|
|
'''
|
|
|
|
from evennia.commands.default.tests import CommandTest
|
|
from evennia.commands.default import general
|
|
from evennia import create_object
|
|
|
|
from typeclasses import rooms, mech
|
|
|
|
class TestMech(CommandTest):
|
|
'''
|
|
Tests for Mech
|
|
'''
|
|
def setUp(self):
|
|
'Create a test mech'
|
|
super().setUp()
|
|
self.mech = create_object(mech.Mech, key='a giant mech',
|
|
location=self.room1, aliases=['mech'])
|
|
|
|
def test_return_appearance(self):
|
|
'Tests for look behavior'
|
|
self.call(general.CmdLook(), 'mech', "You see a large mech. It looks like it has missiles and stuff.")
|
|
self.char1.move_to(self.mech)
|
|
self.call(general.CmdLook(), 'mech', "You see the insides of a large mech.")
|
|
self.char1.move_to(self.room1)
|
|
|
|
def test_at_object_creation(self):
|
|
'Tests for at_object_creation method'
|
|
|
|
# Need to remove permissions to test locks
|
|
self.char1.account.permissions.remove('Developer')
|
|
|
|
self.call(general.CmdGet(), 'mech', "You can't possibly lift this")
|
|
|