How to use the pyscaffold.cli.run function in PyScaffold

To help you get started, we’ve selected a few PyScaffold examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyscaffold / pyscaffold / tests / extensions / test_travis.py View on Github external
def test_cli_without_travis(tmpfolder):
    # Given the command line without the travis option,
    sys.argv = ["pyscaffold", "proj"]

    # when pyscaffold runs,
    run()

    # then travis files should not exist
    assert not path_exists("proj/.travis.yml")
    assert not path_exists("proj/tests/travis_install.sh")
github pyscaffold / pyscaffold / tests / extensions / test_cirrus.py View on Github external
def test_cli_with_cirrus(tmpfolder):
    # Given the command line with the cirrus option,
    sys.argv = ["pyscaffold", "--cirrus", "proj"]

    # when pyscaffold runs,
    run()

    # then files from cirrus and other extensions automatically added should
    # exist
    assert path_exists("proj/.cirrus.yml")
    assert path_exists("proj/tox.ini")
    assert path_exists("proj/.pre-commit-config.yaml")
github pyscaffold / pyscaffold / tests / extensions / test_no_skeleton.py View on Github external
def test_cli_without_no_skeleton(tmpfolder):
    # Given the command line without the tox option,
    sys.argv = ["pyscaffold", "proj"]

    # when pyscaffold runs,
    run()

    # then skeleton file should exist
    assert path_exists("proj/src/proj/skeleton.py")
    assert path_exists("proj/tests/test_skeleton.py")
github pyscaffold / pyscaffold / tests / extensions / test_travis.py View on Github external
def test_cli_with_travis(tmpfolder):
    # Given the command line with the travis option,
    sys.argv = ["pyscaffold", "--travis", "proj"]

    # when pyscaffold runs,
    run()

    # then travis files should exist
    assert path_exists("proj/.travis.yml")
    assert path_exists("proj/tests/travis_install.sh")
github pyscaffold / pyscaffold / tests / extensions / test_namespace.py View on Github external
def test_cli_without_namespace(tmpfolder):
    # Given the command line without the namespace option,
    sys.argv = ["pyscaffold", "proj"]

    # when pyscaffold runs,
    run()

    # then namespace files should not exist
    assert not path_exists("proj/src/ns/__init__.py")
github pyscaffold / pyscaffold / tests / extensions / test_django.py View on Github external
def test_cli_with_django_and_update(tmpfolder, capsys):
    # Given a project exists
    create_project(project=PROJ_NAME)

    # when the project is updated
    # with the django extension,
    sys.argv = ["pyscaffold", PROJ_NAME, "--update", "--django"]
    run()

    # then a warning should be displayed
    out, err = capsys.readouterr()
    assert all(
        warn in out + err
        for warn in ("external tools", "not supported", "will be ignored")
    )
github pyscaffold / pyscaffold / tests / extensions / test_no_skeleton.py View on Github external
def test_cli_with_no_skeleton(tmpfolder):
    # Given the command line with the tox option,
    sys.argv = ["pyscaffold", "--no-skeleton", "proj"]

    # when pyscaffold runs,
    run()

    # then skeleton file should not exist
    assert not path_exists("proj/src/proj/skeleton.py")
    assert not path_exists("proj/tests/test_skeleton.py")
github pyscaffold / pyscaffold / tests / extensions / test_cirrus.py View on Github external
def test_cli_without_cirrus(tmpfolder):
    # Given the command line without the cirrus option,
    sys.argv = ["pyscaffold", "proj"]

    # when pyscaffold runs,
    run()

    # then cirrus files should not exist
    assert not path_exists("proj/.cirrus.yml")
github pyscaffold / pyscaffold / tests / test_cli.py View on Github external
def test_run(tmpfolder, git_mock):
    sys.argv = ["pyscaffold", "my-project"]
    cli.run()
    assert os.path.exists(sys.argv[1])
github pyscaffold / pyscaffold / tests / extensions / test_cookiecutter.py View on Github external
def test_cli_with_cookiecutter(tmpfolder):
    # Given the command line with the cookiecutter option,
    sys.argv = ["pyscaffold", PROJ_NAME, "--cookiecutter", COOKIECUTTER_URL]

    # when pyscaffold runs,
    run()

    # then cookiecutter files should exist
    for path in COOKIECUTTER_FILES:
        assert path_exists(path)