Exemplo n.º 1
0
def test_all_licenses():
    opts = {"email": "test@user",
            "project": "my_project",
            "author": "myself",
            "year": 1832}
    for license in templates.licenses.keys():
        opts['license'] = license
        assert templates.license(opts)
Exemplo n.º 2
0
def test_all_licenses():
    args = type("Namespace", (object,), dict())
    args.email = "test@user"
    args.project = "my_project"
    args.author = "myself"
    args.year = 1832
    for license in templates.licenses.keys():
        args.license = license
        assert templates.license(args)
Exemplo n.º 3
0
def test_create_project_with_license(tmpfolder, git_mock):
    _, opts = get_default_options({},
                                  dict(project="my-project",
                                       license="new-bsd"))
    # ^ The entire default options are needed, since template
    #   uses computed information

    create_project(opts)
    assert path_exists("my-project")
    content = tmpfolder.join("my-project/LICENSE.txt").read()
    assert content == templates.license(opts)
Exemplo n.º 4
0
def test_create_project_with_license(tmpfolder, git_mock):
    _, opts = get_default_options({}, dict(
        project="my-project",
        license="new-bsd"))
    # ^ The entire default options are needed, since template
    #   uses computed information

    create_project(opts)
    assert path_exists("my-project")
    content = tmpfolder.join("my-project/LICENSE.txt").read()
    assert content == templates.license(opts)