release_test.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:release-script 作者: mitodl 项目源码 文件源码
def test_init_working_dir():
    """init_working_dir should initialize a valid git repo, and clean up after itself"""
    repo_url = "https://github.com/mitodl/release-script.git"
    access_token = 'fake_access_token'
    with patch('release.check_call', autospec=True) as check_call_mock, init_working_dir(
        access_token, repo_url,
    ) as other_directory:
        assert os.path.exists(other_directory)
    assert not os.path.exists(other_directory)

    calls = check_call_mock.call_args_list
    assert [call[0][0] for call in calls] == [
        ['git', 'init'],
        ['git', 'remote', 'add', 'origin', url_with_access_token(access_token, repo_url)],
        ['git', 'fetch'],
        ['git', 'checkout', '-t', 'origin/master'],
    ]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号