本文整理汇总了Python中settings.Settings.read_settings_from_file方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.read_settings_from_file方法的具体用法?Python Settings.read_settings_from_file怎么用?Python Settings.read_settings_from_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings.Settings
的用法示例。
在下文中一共展示了Settings.read_settings_from_file方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_current_settings_should_return_current_settings
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import read_settings_from_file [as 别名]
def test_get_current_settings_should_return_current_settings(self):
settings_xml = Settings()
settings_xml.read_settings_from_file()
current_settings = settings_xml.get_current_settings()
shared_items = set(current_settings.items()) & set(expected.items())
self.assertEqual(True, True)
示例2: test_set_config_should_update_value_for_algorithm_to_backtracking
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import read_settings_from_file [as 别名]
def test_set_config_should_update_value_for_algorithm_to_backtracking(self):
new_default = "Backtracking"
settings_xml = Settings()
settings_xml.read_settings_from_file()
settings_xml.set_config("Algorithm", new_default)
settings_xml.write_settings()
settings_xml.read_settings_from_file()
result = settings_xml.get_name_for_current_setting("Algorithm")
self.assertEqual(new_default, result)
示例3: test_set_config_should_update_value_for_level_easy_to_max_35
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import read_settings_from_file [as 别名]
def test_set_config_should_update_value_for_level_easy_to_max_35(self):
setting_node = "Level"
setting_name = "Easy"
attribute_name = "max"
new_attribute_value = "35"
settings_xml = Settings()
settings_xml.read_settings_from_file()
settings_xml.set_config_attributes(setting_node, setting_name, attribute_name, new_attribute_value)
settings_xml.write_settings()
settings_xml.read_settings_from_file()
result = settings_xml.get_attribute_value_for_setting(setting_node, setting_name, attribute_name)
self.assertEqual(new_attribute_value, result)