本文整理汇总了Python中behave.configuration.Configuration.userdata方法的典型用法代码示例。如果您正苦于以下问题:Python Configuration.userdata方法的具体用法?Python Configuration.userdata怎么用?Python Configuration.userdata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类behave.configuration.Configuration
的用法示例。
在下文中一共展示了Configuration.userdata方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_update_userdata__without_cmdline_defines
# 需要导入模块: from behave.configuration import Configuration [as 别名]
# 或者: from behave.configuration.Configuration import userdata [as 别名]
def test_update_userdata__without_cmdline_defines(self):
config = Configuration("", load_config=False)
config.userdata = UserData(person1="AAA", person3="Charly")
config.update_userdata(dict(person1="Alice", person2="Bob"))
expected_data = dict(person1="Alice", person2="Bob", person3="Charly")
eq_(config.userdata, expected_data)
self.assertFalse(config.userdata_defines)
示例2: test_setup_userdata
# 需要导入模块: from behave.configuration import Configuration [as 别名]
# 或者: from behave.configuration.Configuration import userdata [as 别名]
def test_setup_userdata(self):
config = Configuration("", load_config=False)
config.userdata = dict(person1="Alice", person2="Bob")
config.userdata_defines = [("person2", "Charly")]
config.setup_userdata()
expected_data = dict(person1="Alice", person2="Charly")
eq_(config.userdata, expected_data)
示例3: test_update_userdata__with_cmdline_defines
# 需要导入模块: from behave.configuration import Configuration [as 别名]
# 或者: from behave.configuration.Configuration import userdata [as 别名]
def test_update_userdata__with_cmdline_defines(self):
# -- NOTE: cmdline defines are reapplied.
config = Configuration("-D person2=Bea", load_config=False)
config.userdata = UserData(person1="AAA", person3="Charly")
config.update_userdata(dict(person1="Alice", person2="Bob"))
expected_data = dict(person1="Alice", person2="Bea", person3="Charly")
eq_(config.userdata, expected_data)
eq_(config.userdata_defines, [("person2", "Bea")])