本文整理汇总了Python中cleo.application.Application.get_name方法的典型用法代码示例。如果您正苦于以下问题:Python Application.get_name方法的具体用法?Python Application.get_name怎么用?Python Application.get_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cleo.application.Application
的用法示例。
在下文中一共展示了Application.get_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_set_get_name
# 需要导入模块: from cleo.application import Application [as 别名]
# 或者: from cleo.application.Application import get_name [as 别名]
def test_set_get_name(self):
"""
Application name accessors behave properly
"""
application = Application()
application.set_name("foo")
self.assertEqual("foo", application.get_name(), msg=".set_name() sets the name of the application")
示例2: test_constructor
# 需要导入模块: from cleo.application import Application [as 别名]
# 或者: from cleo.application.Application import get_name [as 别名]
def test_constructor(self):
"""
Application.__init__() behaves properly
"""
application = Application("foo", "bar")
self.assertEqual(
"foo", application.get_name(), msg="__init__() takes the application name as its first argument"
)
self.assertEqual(
"bar", application.get_version(), msg="__init__() takes the application version as its second argument"
)
self.assertEqual(
["help", "list"].sort(),
list(application.all().keys()).sort(),
msg="__init__() registered the help and list commands by default",
)