当前位置: 首页>>代码示例>>Python>>正文


Python config._load函数代码示例

本文整理汇总了Python中mopidy.config._load函数的典型用法代码示例。如果您正苦于以下问题:Python _load函数的具体用法?Python _load怎么用?Python _load使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_load函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_load_file_with_utf8

 def test_load_file_with_utf8(self):
     expected = {'foo': {'bar': 'æøå'.encode('utf-8')}}
     result = config._load([path_to_data_dir('file3.conf')], [], [])
     self.assertEqual(expected, result)
开发者ID:Baileym1,项目名称:mopidy,代码行数:4,代码来源:test_config.py

示例2: test_load_file_with_error

 def test_load_file_with_error(self):
     expected = {'foo': {'bar': 'baz'}}
     result = config._load([path_to_data_dir('file4.conf')], [], [])
     self.assertEqual(expected, result)
开发者ID:Baileym1,项目名称:mopidy,代码行数:4,代码来源:test_config.py

示例3: test_load_files

 def test_load_files(self):
     file1 = path_to_data_dir('file1.conf')
     file2 = path_to_data_dir('file2.conf')
     expected = {'foo': {'bar': 'baz'}, 'foo2': {'bar': 'baz'}}
     result = config._load([file1, file2], [], [])
     self.assertEqual(expected, result)
开发者ID:Baileym1,项目名称:mopidy,代码行数:6,代码来源:test_config.py

示例4: test_load_directory_only_conf_files

 def test_load_directory_only_conf_files(self):
     directory = path_to_data_dir('conf2.d')
     expected = {'foo': {'bar': 'baz'}}
     result = config._load([directory], [], [])
     self.assertEqual(expected, result)
开发者ID:Baileym1,项目名称:mopidy,代码行数:5,代码来源:test_config.py

示例5: test_load_overrides

 def test_load_overrides(self):
     override1 = ('foo', 'bar', 'baz')
     override2 = ('foo2', 'bar', 'baz')
     expected = {'foo': {'bar': 'baz'}, 'foo2': {'bar': 'baz'}}
     result = config._load([], [], [override1, override2])
     self.assertEqual(expected, result)
开发者ID:Baileym1,项目名称:mopidy,代码行数:6,代码来源:test_config.py

示例6: test_load_single_file

 def test_load_single_file(self):
     file1 = path_to_data_dir('file1.conf')
     expected = {'foo': {'bar': 'baz'}}
     result = config._load([file1], [], [])
     self.assertEqual(expected, result)
开发者ID:Baileym1,项目名称:mopidy,代码行数:5,代码来源:test_config.py

示例7: test_load_defaults

 def test_load_defaults(self):
     default1 = b'[foo]\nbar = baz'
     default2 = b'[foo2]\n'
     expected = {'foo': {'bar': 'baz'}, 'foo2': {}}
     result = config._load([], [default1, default2], [])
     self.assertEqual(expected, result)
开发者ID:Baileym1,项目名称:mopidy,代码行数:6,代码来源:test_config.py

示例8: test_load_single_override

 def test_load_single_override(self):
     override = ('foo', 'bar', 'baz')
     expected = {'foo': {'bar': 'baz'}}
     result = config._load([], [], [override])
     self.assertEqual(expected, result)
开发者ID:Baileym1,项目名称:mopidy,代码行数:5,代码来源:test_config.py

示例9: test_unicode_default

 def test_unicode_default(self):
     default = '[foo]\nbar = æøå'
     expected = {'foo': {'bar': 'æøå'.encode('utf-8')}}
     result = config._load([], [default], [])
     self.assertEqual(expected, result)
开发者ID:Baileym1,项目名称:mopidy,代码行数:5,代码来源:test_config.py

示例10: test_load_single_default

 def test_load_single_default(self):
     default = b'[foo]\nbar = baz'
     expected = {'foo': {'bar': 'baz'}}
     result = config._load([], [default], [])
     self.assertEqual(expected, result)
开发者ID:Baileym1,项目名称:mopidy,代码行数:5,代码来源:test_config.py

示例11: test_load_nothing

 def test_load_nothing(self):
     self.assertEqual({}, config._load([], [], []))
开发者ID:Baileym1,项目名称:mopidy,代码行数:2,代码来源:test_config.py

示例12: test_load_nonreadable_file

 def test_load_nonreadable_file(self, access_mock):
     access_mock.return_value = False
     file1 = path_to_data_dir('file1.conf')
     result = config._load([file1], [], [])
     self.assertEqual({}, result)
开发者ID:AddBassStudios,项目名称:mopidy,代码行数:5,代码来源:test_config.py

示例13: test_load_missing_file

 def test_load_missing_file(self):
     file0 = path_to_data_dir('file0.conf')
     result = config._load([file0], [], [])
     self.assertEqual({}, result)
开发者ID:AddBassStudios,项目名称:mopidy,代码行数:4,代码来源:test_config.py


注:本文中的mopidy.config._load函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。