本文整理汇总了Python中oasis.lib.General.handle_multi方法的典型用法代码示例。如果您正苦于以下问题:Python General.handle_multi方法的具体用法?Python General.handle_multi怎么用?Python General.handle_multi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oasis.lib.General
的用法示例。
在下文中一共展示了General.handle_multi方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_instance_generate_multi_answer
# 需要导入模块: from oasis.lib import General [as 别名]
# 或者: from oasis.lib.General import handle_multi [as 别名]
def test_instance_generate_multi_answer():
""" Convert some html templates + variables into resulting instance HTML
and make sure it's doing it right. Focus on multi "ANSWER MULTI"
No side effects.
"""
tmpl = "blah<ANSWER1 MULTI f,g,h,i>blah"
qvars = {'f': 7, 'g': "joe", "h": "3.4", "i": 33}
html = """<table border=0><tr><th>Please choose one:</th><td CLASS='multichoicecell'><INPUT class='auto_save' TYPE='radio' NAME='ANS_1' VALUE='1' Oa_CHK_1_1> 7</td><td CLASS='multichoicecell'><INPUT class='auto_save' TYPE='radio' NAME='ANS_1' VALUE='2' Oa_CHK_1_2> joe</td><td CLASS='multichoicecell'><INPUT class='auto_save' TYPE='radio' NAME='ANS_1' VALUE='3' Oa_CHK_1_3> 3.4</td><td CLASS='multichoicecell'><INPUT class='auto_save' TYPE='radio' NAME='ANS_1' VALUE='4' Oa_CHK_1_4> 33</td></tr></table><br />\n"""
res = General.handle_multi(tmpl, 1, qvars, shuffle=False)[1]
assert res == html