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"]
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_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_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"]
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"]
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)
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_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)
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
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
def test_make_structure(): args = type("Namespace", (), {"project": "project", "package": "package", "description": "description"}) struct = structure.make_structure(args) assert isinstance(struct, dict)
def test_make_structure(): args = ["project", "-p", "package", "-d", "description"] args = runner.parse_args(args) struct = structure.make_structure(args) assert isinstance(struct, dict)