Exemplo n.º 1
0
def test_freeze_nested_vcs(script, outer_vcs, inner_vcs):
    """Test VCS can be correctly freezed when resides inside another VCS repo.
    """
    # Create Python package.
    pkg_path = _create_test_package(script, vcs=inner_vcs)

    # Create outer repo to clone into.
    root_path = script.scratch_path.joinpath("test_freeze_nested_vcs")
    root_path.mkdir()
    root_path.joinpath(".hgignore").write_text("src")
    root_path.joinpath(".gitignore").write_text("src")
    _vcs_add(script, root_path, outer_vcs)

    # Clone Python package into inner directory and install it.
    src_path = root_path.joinpath("src")
    src_path.mkdir()
    script.run(inner_vcs, "clone", pkg_path, src_path, expect_stderr=True)
    script.pip("install", "-e", src_path, expect_stderr=True)

    # Check the freeze output recognizes the inner VCS.
    result = script.pip("freeze", expect_stderr=True)
    _check_output(
        result.stdout,
        "...-e {}+...#egg=version_pkg\n...".format(inner_vcs),
    )
Exemplo n.º 2
0
def test_export_rev(script, tmpdir):
    """Test that a Bazaar branch can be exported, specifying a rev."""
    source_dir = tmpdir / 'test-source'
    source_dir.mkdir()

    # Create a single file that is changed by two revisions.
    create_file(source_dir / 'test_file', 'something initial')
    _vcs_add(script, str(source_dir), vcs='bazaar')

    create_file(source_dir / 'test_file', 'something new')
    script.run(
        'bzr',
        'commit',
        '-q',
        '--author',
        'pip <*****@*****.**>',
        '-m',
        'change test file',
        cwd=source_dir,
    )

    export_dir = tmpdir / 'export'
    url = hide_url('bzr+' + _test_path_to_file_url(source_dir) + '@1')
    Bazaar().export(str(export_dir), url=url)

    with open(export_dir / 'test_file', 'r') as f:
        assert f.read() == 'something initial'
Exemplo n.º 3
0
def test_export(script, tmpdir):
    """Test that a Bazaar branch can be exported."""
    source_dir = tmpdir / 'test-source'
    source_dir.mkdir()

    create_file(source_dir / 'test_file', 'something')

    _vcs_add(script, str(source_dir), vcs='bazaar')

    export_dir = str(tmpdir / 'export')
    url = hide_url('bzr+' + _test_path_to_file_url(source_dir))
    Bazaar().export(export_dir, url=url)

    assert os.listdir(export_dir) == ['test_file']
Exemplo n.º 4
0
def test_export(script, tmpdir):
    """Test that a Bazaar branch can be exported."""
    source_dir = tmpdir / 'test-source'
    source_dir.mkdir()

    create_file(source_dir / 'test_file', 'something')

    _vcs_add(script, str(source_dir), vcs='bazaar')

    export_dir = str(tmpdir / 'export')
    url = 'bzr+' + _test_path_to_file_url(source_dir)
    Bazaar().export(export_dir, url=url)

    assert os.listdir(export_dir) == ['test_file']
Exemplo n.º 5
0
def test_export_rev(script, tmpdir):
    """Test that a Bazaar branch can be exported, specifying a rev."""
    source_dir = tmpdir / 'test-source'
    source_dir.mkdir()

    # Create a single file that is changed by two revisions.
    create_file(source_dir / 'test_file', 'something initial')
    _vcs_add(script, str(source_dir), vcs='bazaar')

    create_file(source_dir / 'test_file', 'something new')
    script.run(
        'bzr', 'commit', '-q',
        '--author', 'pip <*****@*****.**>',
        '-m', 'change test file', cwd=source_dir,
    )

    export_dir = tmpdir / 'export'
    url = 'bzr+' + _test_path_to_file_url(source_dir) + '@1'
    Bazaar().export(str(export_dir), url=url)

    with open(export_dir / 'test_file', 'r') as f:
        assert f.read() == 'something initial'