mirror of
https://github.com/evennia/evennia.git
synced 2026-04-01 21:47:17 +02:00
Start setting up unittests for typeclass tests
This commit is contained in:
parent
3ae096859e
commit
039308b573
1 changed files with 21 additions and 0 deletions
21
evennia/typeclasses/tests.py
Normal file
21
evennia/typeclasses/tests.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
"""
|
||||
Unit tests for typeclass base system
|
||||
|
||||
"""
|
||||
|
||||
from evennia.utils.test_resources import EvenniaTest
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Manager tests
|
||||
# ------------------------------------------------------------
|
||||
|
||||
|
||||
class TestTypedObjectManager(EvenniaTest):
|
||||
def _manager(self, methodname, *args, **kwargs):
|
||||
return getattr(self.obj1.__class__.objects, methodname)(*args, **kwargs)
|
||||
|
||||
def test_get_by_tag_no_category(self):
|
||||
self.obj1.tags.add("tag1")
|
||||
self.obj2.tags.add("tag2")
|
||||
self.obj2.tags.add("tag3")
|
||||
self.assertEquals(list(self._manager("get_by_tag", "tag1")), [self.obj1l])
|
||||
Loading…
Add table
Add a link
Reference in a new issue