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)
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)
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
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"
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"
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
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"
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
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"
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
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])
def test_main(tmpdir, git_mock): # noqa args = ["my-project"] runner.main(args) assert os.path.exists(args[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)
def test_main_with_git_not_configured(noconfgit_mock): # noqa args = ["my-project"] with pytest.raises(RuntimeError): runner.main(args)
def test_main_with_nogit(nogit_mock): # noqa args = ["my-project"] with pytest.raises(RuntimeError): runner.main(args)
def test_main_with_nogit(nogit_mock): args = ["my-project"] with pytest.raises(RuntimeError): runner.main(args)
def test_main_when_folder_exists(tmpdir, git_mock): args = ["my-project"] os.mkdir(args[0]) with pytest.raises(RuntimeError): runner.main(args)
def test_main(tmpdir, git_mock): args = ["my-project"] runner.main(args) assert os.path.exists(args[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])
def test_main_with_license(tmpdir, git_mock): # noqa args = ["my-project", "-l", "new-bsd"] runner.main(args) assert os.path.exists(args[0])
def test_main_with_license(tmpdir, git_mock): args = ["my-project", "-l", "new-bsd"] runner.main(args) assert os.path.exists(args[0])