def test_skip_unknown_host(self):
mocked_task = mock.Mock()
@fabricio.tasks.skip_unknown_host
def task():
mocked_task()
with fab.settings(fab.hide('everything')):
fab.execute(task)
mocked_task.assert_not_called()
fab.execute(task, host='host')
mocked_task.assert_called_once()
评论列表
文章目录