예제 #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"]
예제 #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)
예제 #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"]
예제 #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"]
예제 #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"]
예제 #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"]
예제 #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)
예제 #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"]
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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
예제 #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
예제 #15
0
def test_make_structure():
    args = type("Namespace", (), {"project": "project",
                                  "package": "package",
                                  "description": "description"})
    struct = structure.make_structure(args)
    assert isinstance(struct, dict)
예제 #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)
예제 #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)