def test_with_config(self, is_file, open_):
# Create our stand-in config file.
config_file = textwrap.dedent(u"""\
---
local_paths:
reporoot: ~/Code
publish: local
""")
is_file.return_value = True
open_.return_value = io.StringIO(config_file)
# Get the config and test the result.
flags = Namespace(user_config='/bogus/file.yaml', command='not_init')
user_config = main.read_user_config(flags)
assert user_config == {
'local_paths': {'reporoot': '~/Code'},
'publish': 'local',
}
评论列表
文章目录