def test_docfile_chdir(tmpdir):
tmpdir.ensure('nested/file').write('some text\n')
example = tmpdir.join('example.txt')
example.write('some shell test\n'
' nested $ cat file\n'
' some other text\n')
action, = list(actions_of(example))
excpected_action = {
'action': 'shell',
'file': example,
'content': 'some other text\n',
'cwd': 'nested',
'indent': 2,
'line': 1,
'target': 'cat file',
}
assert action == excpected_action
needed_updates = check_file(example, tmpdir)
py.std.pprint.pprint(needed_updates)
assert needed_updates
评论列表
文章目录