예제 #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])