Ejemplo n.º 1
0
def test_make_structure_without_vagrant():
    args = ["project", "-p", "package", "-d", "description"]
    opts = cli.parse_args(args)
    opts = cli.get_default_opts(opts['project'], **opts)
    struct = structure.make_structure(opts)
    assert isinstance(struct, dict)
    assert "vagrant" not in struct["project"]
Ejemplo n.º 2
0
def test_make_structure_with_tox():
    args = ["project", "-p", "package", "-d", "description", "--with-tox"]
    opts = cli.parse_args(args)
    opts = cli.get_default_opts(opts['project'], **opts)
    struct = structure.make_structure(opts)
    assert isinstance(struct, dict)
    assert "tox.ini" in struct["project"]
    assert isinstance(struct["project"]["tox.ini"], six.string_types)
Ejemplo n.º 3
0
def test_make_structure_with_pre_commit_hooks():
    args = [
        "project", "-p", "package", "-d", "description", "--with-pre-commit"
    ]
    opts = cli.parse_args(args)
    opts = cli.get_default_opts(opts['project'], **opts)
    struct = structure.make_structure(opts)
    assert isinstance(struct, dict)
    assert ".pre-commit-config.yaml" in struct["project"]
Ejemplo n.º 4
0
def test_make_structure_with_pre_commit_hooks():
    args = ["project",
            "-p", "package",
            "-d", "description",
            "--with-pre-commit"]
    args = runner.parse_args(args)
    struct = structure.make_structure(args)
    assert isinstance(struct, dict)
    assert ".pre-commit-config.yaml" in struct["project"]
Ejemplo n.º 5
0
def test_make_structure_without_vagrant():
    args = ["project",
            "-p", "package",
            "-d", "description"]
    opts = cli.parse_args(args)
    opts = cli.get_default_opts(opts['project'], **opts)
    struct = structure.make_structure(opts)
    assert isinstance(struct, dict)
    assert "vagrant" not in struct["project"]
Ejemplo n.º 6
0
def test_make_structure_with_pre_commit_hooks():
    args = ["project",
            "-p", "package",
            "-d", "description",
            "--with-pre-commit"]
    args = runner.parse_args(args)
    args = structure.set_default_args(args)
    struct = structure.make_structure(args)
    assert isinstance(struct, dict)
    assert ".pre-commit-config.yaml" in struct["project"]
Ejemplo n.º 7
0
def test_make_structure_with_tox():
    args = ["project",
            "-p", "package",
            "-d", "description",
            "--with-tox"]
    args = runner.parse_args(args)
    struct = structure.make_structure(args)
    assert isinstance(struct, dict)
    assert "tox.ini" in struct["project"]
    assert isinstance(struct["project"]["tox.ini"], six.string_types)
Ejemplo n.º 8
0
def test_make_structure_with_pre_commit_hooks():
    args = ["project",
            "-p", "package",
            "-d", "description",
            "--with-pre-commit"]
    opts = cli.parse_args(args)
    opts = cli.get_default_opts(opts['project'], **opts)
    struct = structure.make_structure(opts)
    assert isinstance(struct, dict)
    assert ".pre-commit-config.yaml" in struct["project"]
Ejemplo n.º 9
0
def test_make_structure_with_tox():
    args = ["project",
            "-p", "package",
            "-d", "description",
            "--with-tox"]
    opts = cli.parse_args(args)
    opts = cli.get_default_opts(opts['project'], **opts)
    struct = structure.make_structure(opts)
    assert isinstance(struct, dict)
    assert "tox.ini" in struct["project"]
    assert isinstance(struct["project"]["tox.ini"], six.string_types)
Ejemplo n.º 10
0
def test_make_structure_with_tox():
    args = ["project",
            "-p", "package",
            "-d", "description",
            "--with-tox"]
    args = runner.parse_args(args)
    args = structure.set_default_args(args)
    struct = structure.make_structure(args)
    assert isinstance(struct, dict)
    assert "tox.ini" in struct["project"]
    assert isinstance(struct["project"]["tox.ini"], six.string_types)
Ejemplo n.º 11
0
def test_make_structure_with_vagrant():
    args = ["project",
            "-p", "package",
            "-d", "description",
            "--with-vagrant", "debian/jessie64"]
    opts = cli.parse_args(args)
    opts = cli.get_default_opts(opts['project'], **opts)
    struct = structure.make_structure(opts)
    assert isinstance(struct, dict)
    assert "Vagrantfile" in struct["project"]["vagrant"]
    assert isinstance(struct["project"]["vagrant"]["Vagrantfile"], six.string_types)
Ejemplo n.º 12
0
def test_make_structure_with_vagrant():
    args = [
        "project", "-p", "package", "-d", "description", "--with-vagrant",
        "debian/jessie64"
    ]
    opts = cli.parse_args(args)
    opts = cli.get_default_opts(opts['project'], **opts)
    struct = structure.make_structure(opts)
    assert isinstance(struct, dict)
    assert "Vagrantfile" in struct["project"]["vagrant"]
    assert isinstance(struct["project"]["vagrant"]["Vagrantfile"],
                      six.string_types)
Ejemplo n.º 13
0
def test_version_of_subdir(tmpdir):  # noqa
    projects = ["main_project", "inner_project"]
    for project in projects:
        opts = cli.parse_args([project])
        opts = cli.get_default_opts(opts['project'], **opts)
        struct = structure.make_structure(opts)
        structure.create_structure(struct)
        repo.init_commit_repo(project, struct)
    shutil.rmtree(os.path.join('inner_project', '.git'))
    shutil.move('inner_project', 'main_project/inner_project')
    with utils.chdir('main_project'):
        main_version = subprocess.check_output(
            ['python', 'setup.py', '--version']).strip()
        with utils.chdir('inner_project'):
            inner_version = subprocess.check_output(
                ['python', 'setup.py', '--version']).strip()
    assert main_version == inner_version
Ejemplo n.º 14
0
def test_version_of_subdir(tmpdir): # noqa
    projects = ["main_project", "inner_project"]
    for project in projects:
        opts = cli.parse_args([project])
        opts = cli.get_default_opts(opts['project'], **opts)
        struct = structure.make_structure(opts)
        structure.create_structure(struct)
        repo.init_commit_repo(project, struct)
    shutil.rmtree(os.path.join('inner_project', '.git'))
    shutil.move('inner_project', 'main_project/inner_project')
    with utils.chdir('main_project'):
        main_version = subprocess.check_output([
            'python', 'setup.py', '--version']).strip()
        with utils.chdir('inner_project'):
            inner_version = subprocess.check_output([
                'python', 'setup.py', '--version']).strip()
    assert main_version == inner_version
Ejemplo n.º 15
0
def test_make_structure():
    args = type("Namespace", (), {"project": "project",
                                  "package": "package",
                                  "description": "description"})
    struct = structure.make_structure(args)
    assert isinstance(struct, dict)
Ejemplo n.º 16
0
def test_make_structure():
    args = ["project", "-p", "package", "-d", "description"]
    args = runner.parse_args(args)
    struct = structure.make_structure(args)
    assert isinstance(struct, dict)
Ejemplo n.º 17
0
def test_make_structure():
    args = ["project", "-p", "package", "-d", "description"]
    args = runner.parse_args(args)
    struct = structure.make_structure(args)
    assert isinstance(struct, dict)