def test_git_commit(tmpworkdir):
mktree(tmpworkdir, {
'test.js': 'X',
'harrier.yml': """\
root: .
assets:
active: True"""
})
with patch('harrier.tools.subprocess.run') as mock_run:
mock_run.return_value = CompletedProcess(args=[], returncode=0, stdout=b'commit sha1\n')
config = Config('harrier.yml')
config.setup()
build(config)
assert gettree(tmpworkdir.join('build')) == {
'test.js': 'X',
'assets.json': """\
{
"commit": "commit sha1",
"files": {
"test.js": "/test.js"
}
}
""",
}
assert mock_run.called
评论列表
文章目录