Start unit tests, fixed syntax errors
This commit is contained in:
parent
a96a896b5b
commit
dcf2cd778c
2 changed files with 20 additions and 1 deletions
|
|
@ -191,7 +191,7 @@ def init_fill_field(formtemplate, caller, callback, pretext="", posttext="",
|
||||||
"pretext": pretext,
|
"pretext": pretext,
|
||||||
"posttext": posttext,
|
"posttext": posttext,
|
||||||
"submitcmd": submitcmd,
|
"submitcmd": submitcmd,
|
||||||
"borderstyle": borderstyle
|
"borderstyle": borderstyle,
|
||||||
"helptext": helptext
|
"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.'}]
|
{'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)
|
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
|
# Test of the unixcommand module
|
||||||
|
|
||||||
from evennia.contrib.unixcommand import UnixCommand
|
from evennia.contrib.unixcommand import UnixCommand
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue