mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Made unit test to test case of #3432
This commit is contained in:
parent
e5d07603ca
commit
03f71fa87e
2 changed files with 14 additions and 2 deletions
|
|
@ -11,11 +11,10 @@ import time
|
|||
import typing
|
||||
from collections import defaultdict
|
||||
|
||||
import evennia
|
||||
import inflect
|
||||
from django.conf import settings
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
import evennia
|
||||
from evennia.commands import cmdset
|
||||
from evennia.commands.cmdsethandler import CmdSetHandler
|
||||
from evennia.objects.manager import ObjectManager
|
||||
|
|
|
|||
|
|
@ -114,6 +114,19 @@ class DefaultObjectTest(BaseEvenniaTest):
|
|||
# partial match to 'colon' - multimatch error since stack is not homogenous
|
||||
self.assertEqual(self.char1.search("co", stacked=2), None)
|
||||
|
||||
def test_search_plural_form(self):
|
||||
"""Test searching for plural form of objects"""
|
||||
coin1 = DefaultObject.create("coin", location=self.room1)[0]
|
||||
coin2 = DefaultObject.create("coin", location=self.room1)[0]
|
||||
coin3 = DefaultObject.create("coin", location=self.room1)[0]
|
||||
# build the numbered aliases
|
||||
coin1.get_numbered_name(2, self.char1)
|
||||
coin2.get_numbered_name(3, self.char1)
|
||||
coin3.get_numbered_name(4, self.char1)
|
||||
|
||||
self.assertEqual(self.char1.search("coin", quiet=True), [coin1, coin2, coin3])
|
||||
self.assertEqual(self.char1.search("coins", quiet=True), [coin1, coin2, coin3])
|
||||
|
||||
def test_get_default_lockstring_base(self):
|
||||
pattern = (
|
||||
f"control:pid({self.account.id}) or id({self.char1.id}) or"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue