Пример #1
0
def test_main_when_updating_with_wrong_setup(tmpdir, git_mock):  # noqa
    os.mkdir("my_project")
    open("my_project/versioneer.py", 'a').close()
    open("my_project/setup.py", 'a').close()
    args = ["--update", "my_project"]
    with pytest.raises(RuntimeError):
        runner.main(args)
Пример #2
0
def test_main_when_updating_with_wrong_setup(tmpdir, git_mock):
    os.mkdir("my_project")
    open("my_project/versioneer.py", 'a').close()
    open("my_project/setup.py", 'a').close()
    args = ["--update", "my_project"]
    with pytest.raises(RuntimeError):
        runner.main(args)
Пример #3
0
def test_project_with_junit_coverage_args_overwritten(tmpdir):
    old_args = ["my_project"]
    runner.main(old_args)
    args = ["my_project", "--with-junit-xml", "--with-coverage-xml",
            "--with-coverage-html"]
    args = runner.parse_args(args)
    new_args = info.project(args)
    assert new_args.junit_xml is True
    assert new_args.coverage_xml is True
    assert new_args.coverage_html is True
Пример #4
0
def test_project_without_args(tmpdir):  # noqa
    old_args = ["my_project", "-u", "http://www.blue-yonder.com/",
                "-d", "my description"]
    runner.main(old_args)
    args = ["my_project"]
    args = runner.parse_args(args)
    new_args = info.project(args)
    assert new_args.url == "http://www.blue-yonder.com/"
    assert new_args.package == "my_project"
    assert new_args.license == "none"
    assert new_args.description == "my description"
Пример #5
0
def test_project_with_args(tmpdir):
    old_args = ["my_project", "-u", "http://www.blue-yonder.com/",
                "-d", "my description"]
    runner.main(old_args)
    args = ["my_project", "-u", "http://www.google.com/",
            "-d", "other description", "-l", "new-bsd"]
    args = runner.parse_args(args)
    new_args = info.project(args)
    assert new_args.url == "http://www.google.com/"
    assert new_args.package == "my_project"
    assert new_args.license == "new BSD"
    assert new_args.description == "other description"
Пример #6
0
def test_project_with_junit_coverage_args_overwritten(tmpdir):
    old_args = ["my_project"]
    runner.main(old_args)
    args = [
        "my_project", "--with-junit-xml", "--with-coverage-xml",
        "--with-coverage-html"
    ]
    args = runner.parse_args(args)
    new_args = info.project(args)
    assert new_args.junit_xml is True
    assert new_args.coverage_xml is True
    assert new_args.coverage_html is True
Пример #7
0
def test_project_without_args(tmpdir):  # noqa
    old_args = [
        "my_project", "-u", "http://www.blue-yonder.com/", "-d",
        "my description"
    ]
    runner.main(old_args)
    args = ["my_project"]
    args = runner.parse_args(args)
    new_args = info.project(args)
    assert new_args.url == "http://www.blue-yonder.com/"
    assert new_args.package == "my_project"
    assert new_args.license == "none"
    assert new_args.description == "my description"
Пример #8
0
def test_project_without_args(tmpdir):
    old_args = ["my_project", "-u", "http://www.blue-yonder.com/",
                "-d", "my description"]
    runner.main(old_args)
    args = ["my_project"]
    args = runner.parse_args(args)
    new_args = info.project(args)
    assert new_args.url == "http://www.blue-yonder.com/"
    assert new_args.package == "my_project"
    assert new_args.license == "new BSD"
    assert new_args.description == "my description"
    assert new_args.junit_xml is False
    assert new_args.coverage_xml is False
    assert new_args.coverage_html is False
Пример #9
0
def test_project_with_args(tmpdir):
    old_args = [
        "my_project", "-u", "http://www.blue-yonder.com/", "-d",
        "my description"
    ]
    runner.main(old_args)
    args = [
        "my_project", "-u", "http://www.google.com/", "-d",
        "other description", "-l", "new-bsd"
    ]
    args = runner.parse_args(args)
    new_args = info.project(args)
    assert new_args.url == "http://www.google.com/"
    assert new_args.package == "my_project"
    assert new_args.license == "new BSD"
    assert new_args.description == "other description"
Пример #10
0
def test_project_without_args(tmpdir):
    old_args = [
        "my_project", "-u", "http://www.blue-yonder.com/", "-d",
        "my description"
    ]
    runner.main(old_args)
    args = ["my_project"]
    args = runner.parse_args(args)
    new_args = info.project(args)
    assert new_args.url == "http://www.blue-yonder.com/"
    assert new_args.package == "my_project"
    assert new_args.license == "new BSD"
    assert new_args.description == "my description"
    assert new_args.junit_xml is False
    assert new_args.coverage_xml is False
    assert new_args.coverage_html is False
Пример #11
0
def test_main_when_updating(tmpdir, git_mock):  # noqa
    args = ["my-project"]
    runner.main(args)
    args = ["--update", "my-project"]
    runner.main(args)
    assert os.path.exists(args[1])
Пример #12
0
def test_main(tmpdir, git_mock):  # noqa
    args = ["my-project"]
    runner.main(args)
    assert os.path.exists(args[0])
Пример #13
0
def test_main_when_folder_exists(tmpdir, git_mock):  # noqa
    args = ["my-project"]
    os.mkdir(args[0])
    with pytest.raises(RuntimeError):
        runner.main(args)
Пример #14
0
def test_main_with_git_not_configured(noconfgit_mock):  # noqa
    args = ["my-project"]
    with pytest.raises(RuntimeError):
        runner.main(args)
Пример #15
0
def test_main_with_nogit(nogit_mock):  # noqa
    args = ["my-project"]
    with pytest.raises(RuntimeError):
        runner.main(args)
Пример #16
0
def test_main_with_git_not_configured(noconfgit_mock):  # noqa
    args = ["my-project"]
    with pytest.raises(RuntimeError):
        runner.main(args)
Пример #17
0
def test_main_with_nogit(nogit_mock):
    args = ["my-project"]
    with pytest.raises(RuntimeError):
        runner.main(args)
Пример #18
0
def test_main_when_folder_exists(tmpdir, git_mock):
    args = ["my-project"]
    os.mkdir(args[0])
    with pytest.raises(RuntimeError):
        runner.main(args)
Пример #19
0
def test_main(tmpdir, git_mock):
    args = ["my-project"]
    runner.main(args)
    assert os.path.exists(args[0])
Пример #20
0
def test_main_when_updating(tmpdir, git_mock):
    args = ["my-project"]
    runner.main(args)
    args = ["--update", "my-project"]
    runner.main(args)
    assert os.path.exists(args[1])
Пример #21
0
def test_main_with_license(tmpdir, git_mock):  # noqa
    args = ["my-project", "-l", "new-bsd"]
    runner.main(args)
    assert os.path.exists(args[0])
Пример #22
0
def test_main_with_license(tmpdir, git_mock):
    args = ["my-project", "-l", "new-bsd"]
    runner.main(args)
    assert os.path.exists(args[0])