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"]
Exemple #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)
Exemple #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"]
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"]
Exemple #5
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"]
Exemple #6
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)
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)
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)
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
Exemple #10
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
Exemple #11
0
def test_api_with_cookiecutter(tmpdir):  # noqa
    template = "https://github.com/audreyr/cookiecutter-pypackage.git"
    opts = cli.get_default_opts("created_proj_with_api", cookiecutter_template=template)
    cli.create_project(opts)
    assert os.path.exists("created_proj_with_api")
Exemple #12
0
def test_api(tmpdir):  # noqa
    opts = cli.get_default_opts("created_proj_with_api")
    cli.create_project(opts)
    assert os.path.exists("created_proj_with_api")
Exemple #13
0
def test_get_defaults_opts_with_cookiecutter():
    args = ["project", "--with-cookiecutter", "http://..."]
    opts = cli.parse_args(args)
    new_opts = cli.get_default_opts(opts["project"], **opts)
    assert new_opts["force"]
Exemple #14
0
def test_get_default_opts():
    args = ["project", "-p", "package", "-d", "description"]
    opts = cli.parse_args(args)
    new_opts = cli.get_default_opts(opts["project"], **opts)
    assert "author" not in opts
    assert "author" in new_opts
Exemple #15
0
def test_get_default_opts():
    args = ["project", "-p", "package", "-d", "description"]
    opts = cli.parse_args(args)
    new_opts = cli.get_default_opts(opts['project'], **opts)
    assert "author" not in opts
    assert "author" in new_opts
Exemple #16
0
def test_get_defaults_opts_with_cookiecutter():
    args = ["project", "--with-cookiecutter", "http://..."]
    opts = cli.parse_args(args)
    new_opts = cli.get_default_opts(opts['project'], **opts)
    assert new_opts["force"]
Exemple #17
0
def test_api(tmpdir):  # noqa
    opts = cli.get_default_opts('created_proj_with_api')
    cli.create_project(opts)
    assert os.path.exists('created_proj_with_api')
Exemple #18
0
def test_api_with_cookiecutter(tmpdir):  # noqa
    template = 'https://github.com/audreyr/cookiecutter-pypackage.git'
    opts = cli.get_default_opts('created_proj_with_api',
                                cookiecutter_template=template)
    cli.create_project(opts)
    assert os.path.exists('created_proj_with_api')