mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 05:57:16 +02:00
Start unit tests, fixed syntax errors
This commit is contained in:
parent
5339e9fa61
commit
aa49cd3f03
2 changed files with 20 additions and 1 deletions
|
|
@ -191,7 +191,7 @@ def init_fill_field(formtemplate, caller, callback, pretext="", posttext="",
|
|||
"pretext": pretext,
|
||||
"posttext": posttext,
|
||||
"submitcmd": submitcmd,
|
||||
"borderstyle": borderstyle
|
||||
"borderstyle": borderstyle,
|
||||
"helptext": helptext
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1283,6 +1283,25 @@ class TestTreeSelectFunc(EvenniaTest):
|
|||
{'goto': ['menunode_treeselect', {'newindex': 1}], 'key': ['<< Go Back', 'go back', 'back'], 'desc': 'Return to the previous menu.'}]
|
||||
self.assertTrue(tree_select.optlist_to_menuoptions(TREE_MENU_TESTSTR, test_optlist, 2, True, True) == optlist_to_menu_expected_result)
|
||||
|
||||
# Test field fill
|
||||
|
||||
from evennia.contrib import fieldfill
|
||||
|
||||
FIELD_TEST_TEMPLATE = [
|
||||
{"fieldname":"TextTest", "fieldtype":"text"},
|
||||
{"fieldname":"NumberTest", "fieldtype":"number", "blankmsg":"Number here!"},
|
||||
{"fieldname":"DefaultText", "fieldtype":"text", "default":"Test"},
|
||||
{"fieldname":"DefaultNum", "fieldtype":"number", "default":3}
|
||||
]
|
||||
|
||||
FIELD_TEST_DATA = {"TextTest":None, "NumberTest":None, "DefaultText":"Test", "DefaultNum":3}
|
||||
|
||||
class TestFieldFillFunc(EvenniaTest):
|
||||
|
||||
def test_field_functions(self):
|
||||
# Template to dictionary
|
||||
self.assertTrue(fieldfill.form_template_to_dict(FIELD_TEST_TEMPLATE) == FIELD_TEST_DATA)
|
||||
|
||||
# Test of the unixcommand module
|
||||
|
||||
from evennia.contrib.unixcommand import UnixCommand
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue