本文整理汇总了Python中source.main.Interface.demand方法的典型用法代码示例。如果您正苦于以下问题:Python Interface.demand方法的具体用法?Python Interface.demand怎么用?Python Interface.demand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类source.main.Interface
的用法示例。
在下文中一共展示了Interface.demand方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_ask_open_door
# 需要导入模块: from source.main import Interface [as 别名]
# 或者: from source.main.Interface import demand [as 别名]
def test_ask_open_door(self):
obj = Interface()
question = 'Open the door hal'
result = obj.demand(question)
output_to_file(question, result)
self.assertEqual(result, 'I\'m afraid I can\'t do that ' + getpass.getuser())
示例2: test_random_number_range_invalid
# 需要导入模块: from source.main import Interface [as 别名]
# 或者: from source.main.Interface import demand [as 别名]
def test_random_number_range_invalid(self):
obj = Interface()
question = 'Give me a number between 10 and 10'
result = obj.demand(question)
output_to_file(question, result)
self.assertLessEqual(result, "Invalid range")
示例3: test_demand_unknown
# 需要导入模块: from source.main import Interface [as 别名]
# 或者: from source.main.Interface import demand [as 别名]
def test_demand_unknown(self):
obj = Interface()
result = obj.demand('Give me a soda')
self.assertEqual(result, 'I don\'t know how to do that')
示例4: test_random_number_range_greater
# 需要导入模块: from source.main import Interface [as 别名]
# 或者: from source.main.Interface import demand [as 别名]
def test_random_number_range_greater(self):
obj = Interface()
question = 'Give me a number between 1 and 6'
result = obj.demand(question)
output_to_file(question, result)
self.assertGreaterEqual(result, 1)
示例5: test_demand_invalid_string
# 需要导入模块: from source.main import Interface [as 别名]
# 或者: from source.main.Interface import demand [as 别名]
def test_demand_invalid_string(self):
obj = Interface()
result = obj.demand(2)
self.assertEqual(result, 'Not A String!')