mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Adds test for home kwarg in create() (#1921)
This commit is contained in:
parent
a6f5cccdfa
commit
45abac71f4
1 changed files with 8 additions and 2 deletions
|
|
@ -9,23 +9,29 @@ class DefaultObjectTest(EvenniaTest):
|
|||
|
||||
def test_object_create(self):
|
||||
description = "A home for a grouch."
|
||||
home = self.room1.dbref
|
||||
|
||||
obj, errors = DefaultObject.create(
|
||||
"trashcan", self.account, description=description, ip=self.ip
|
||||
"trashcan", self.account, description=description, ip=self.ip, home=home
|
||||
)
|
||||
self.assertTrue(obj, errors)
|
||||
self.assertFalse(errors, errors)
|
||||
self.assertEqual(description, obj.db.desc)
|
||||
self.assertEqual(obj.db.creator_ip, self.ip)
|
||||
self.assertEqual(obj.db_home, self.room1)
|
||||
|
||||
def test_character_create(self):
|
||||
description = "A furry green monster, reeking of garbage."
|
||||
home = self.room1.dbref
|
||||
|
||||
obj, errors = DefaultCharacter.create(
|
||||
"oscar", self.account, description=description, ip=self.ip
|
||||
"oscar", self.account, description=description, ip=self.ip, home=home
|
||||
)
|
||||
self.assertTrue(obj, errors)
|
||||
self.assertFalse(errors, errors)
|
||||
self.assertEqual(description, obj.db.desc)
|
||||
self.assertEqual(obj.db.creator_ip, self.ip)
|
||||
self.assertEqual(obj.db_home, self.room1)
|
||||
|
||||
def test_room_create(self):
|
||||
description = "A dimly-lit alley behind the local Chinese restaurant."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue