예제 #1
0
def test_handle_requires_repos_with_alternative_syntax(fake_git_clone):
    repos = [{"type": "git", "url": "https://github.com/my/repo"}]
    from moban.mobanfile import handle_requires

    handle_requires(repos)
    fake_git_clone.assert_called_with(
        [GitRequire(git_url="https://github.com/my/repo")])
예제 #2
0
def test_handle_requires_repos(fake_git_clone):
    repos = ["https://github.com/my/repo", "https://gitlab.com/my/repo"]
    from moban.mobanfile import handle_requires

    expected = []
    for repo in repos:
        expected.append(GitRequire(git_url=repo, submodule=False))

    handle_requires(repos)
    fake_git_clone.assert_called_with(expected)
예제 #3
0
def test_handle_requires_repos_with_submodule(fake_git_clone):
    repos = [{
        "type": "git",
        "url": "https://github.com/my/repo",
        "submodule": True
    }]
    from moban.mobanfile import handle_requires

    expected = ["https://github.com/my/repo"]
    handle_requires(repos)
    fake_git_clone.assert_called_with(expected, submodule=True)
예제 #4
0
def test_handle_requires_repos_with_submodule(fake_git_clone,
                                              fake_pip_install):
    repos = [{
        "type": "git",
        "url": "https://github.com/my/repo",
        "submodule": True
    }]
    from moban.mobanfile import handle_requires

    handle_requires(repos)
    fake_git_clone.assert_called_with(
        [GitRequire(git_url="https://github.com/my/repo", submodule=True)])
    eq_(fake_pip_install.called, False)
예제 #5
0
def test_handle_requires_pypkg_with_alternative_syntax(fake_pip_install):
    modules = [{"type": "pypi", "name": "pypi-mobans"}]
    from moban.mobanfile import handle_requires

    handle_requires(modules)
    fake_pip_install.assert_called_with(["pypi-mobans"])
예제 #6
0
def test_handle_requires_pypkg(fake_pip_install):
    modules = ["package1", "package2"]
    from moban.mobanfile import handle_requires

    handle_requires(modules)
    fake_pip_install.assert_called_with(modules)
예제 #7
0
def test_handle_requires_repos(fake_git_clone):
    repos = ["https://github.com/my/repo", "https://gitlab.com/my/repo"]
    from moban.mobanfile import handle_requires

    handle_requires(repos)
    fake_git_clone.assert_called_with(repos)