Fix unittests. Implement #1675.
This commit is contained in:
parent
8b1ab0bc85
commit
550a25820d
2 changed files with 4 additions and 3 deletions
|
|
@ -94,7 +94,7 @@ def homogenize_prototype(prototype, custom_keys=None):
|
||||||
homogenized["prototype_key"] = "prototype-{}".format(
|
homogenized["prototype_key"] = "prototype-{}".format(
|
||||||
hashlib.md5(str(time.time())).hexdigest()[:7])
|
hashlib.md5(str(time.time())).hexdigest()[:7])
|
||||||
|
|
||||||
if "typeclass" not in prototype:
|
if "typeclass" not in prototype and "prototype_parent" not in prototype:
|
||||||
homogenized["typeclass"] = settings.BASE_OBJECT_TYPECLASS
|
homogenized["typeclass"] = settings.BASE_OBJECT_TYPECLASS
|
||||||
|
|
||||||
return homogenized
|
return homogenized
|
||||||
|
|
|
||||||
|
|
@ -384,8 +384,9 @@ class TestPrototypeStorage(EvenniaTest):
|
||||||
prot3 = protlib.create_prototype(**self.prot3)
|
prot3 = protlib.create_prototype(**self.prot3)
|
||||||
|
|
||||||
# partial match
|
# partial match
|
||||||
self.assertEqual(list(protlib.search_prototype("prot")), [prot1b, prot2, prot3])
|
with mock.patch("evennia.prototypes.prototypes._MODULE_PROTOTYPES", {}):
|
||||||
self.assertEqual(list(protlib.search_prototype(tags="foo1")), [prot1b, prot2, prot3])
|
self.assertEqual(list(protlib.search_prototype("prot")), [prot1b, prot2, prot3])
|
||||||
|
self.assertEqual(list(protlib.search_prototype(tags="foo1")), [prot1b, prot2, prot3])
|
||||||
|
|
||||||
self.assertTrue(str(unicode(protlib.list_prototypes(self.char1))))
|
self.assertTrue(str(unicode(protlib.list_prototypes(self.char1))))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue