Example #1
0
    def test_software_collection(self):
        root = get_root()
        software_collection = SoftwareCollection()
        assert software_collection.type_info.addable(root, DummyRequest()) is True
        root['software_collection'] = software_collection

        software_project = SoftwareProject()

        assert len(software_collection.values()) == 0

        # there are no children of type SoftwareProject yet, the UI should present the add link
        assert software_project.type_info.addable(software_collection, DummyRequest()) is True

        software_collection['software_project'] = software_project

        assert len(software_collection.values()) == 1
Example #2
0
    def test_software_collection(self):
        root = get_root()
        software_collection = SoftwareCollection()
        assert software_collection.type_info.addable(root,
                                                     DummyRequest()) is True
        root['software_collection'] = software_collection

        software_project = SoftwareProject()

        assert len(software_collection.values()) == 0

        # there are no children of type SoftwareProject yet, the UI should present the add link
        assert software_project.type_info.addable(software_collection,
                                                  DummyRequest()) is True

        software_collection['software_project'] = software_project

        assert len(software_collection.values()) == 1
Example #3
0
    def test_software_project_only_bitbucket_owner_and_repo_provided(self):
        root = get_root()
        software_collection = SoftwareCollection()
        root['software_collection'] = software_collection

        software_project = SoftwareProject(bitbucket_owner="pypy",
                                           bitbucket_repo="pypy")

        software_collection['software_project'] = software_project

        assert len(software_collection.values()) == 1
Example #4
0
    def test_software_project_only_github_owner_and_repo_provided(self):
        root = get_root()
        software_collection = SoftwareCollection()
        root['software_collection'] = software_collection

        software_project = SoftwareProject(github_owner="geojeff",
                                           github_repo="kotti_software")

        software_collection['software_project'] = software_project

        assert len(software_collection.values()) == 1
Example #5
0
    def test_software_project_only_pypi_url_provided(self):
        root = get_root()
        software_collection = SoftwareCollection()
        root['software_collection'] = software_collection

        software_project = SoftwareProject(
            pypi_url="http://pypi.python.org/pypi/kotti_software/json")

        software_collection['software_project'] = software_project

        assert len(software_collection.values()) == 1
Example #6
0
    def test_software_project_only_pypi_url_provided(self):
        root = get_root()
        software_collection = SoftwareCollection()
        root['software_collection'] = software_collection

        software_project = SoftwareProject(
                pypi_url="http://pypi.python.org/pypi/kotti_software/json")

        software_collection['software_project'] = software_project

        assert len(software_collection.values()) == 1
Example #7
0
    def test_software_project_only_bitbucket_owner_and_repo_provided(self):
        root = get_root()
        software_collection = SoftwareCollection()
        root['software_collection'] = software_collection

        software_project = SoftwareProject(
                bitbucket_owner="pypy",
                bitbucket_repo="pypy")

        software_collection['software_project'] = software_project

        assert len(software_collection.values()) == 1
Example #8
0
    def test_software_project_only_github_owner_and_repo_provided(self):
        root = get_root()
        software_collection = SoftwareCollection()
        root['software_collection'] = software_collection

        software_project = SoftwareProject(
                github_owner="geojeff",
                github_repo="kotti_software")

        software_collection['software_project'] = software_project

        assert len(software_collection.values()) == 1
Example #9
0
    def test_software_project_bitbucket_data(self):
        root = get_root()
        software_collection = SoftwareCollection()
        root['software_collection'] = software_collection

        software_project = SoftwareProject(
            title="kotti_software Project",
            date_handling_choice="use_bitbucket_date",
            desc_handling_choice="use_bitbucket_description",
            bitbucket_owner="pypy",
            bitbucket_repo="pypy")

        software_collection['software_project'] = software_project

        assert len(software_collection.values()) == 1
Example #10
0
    def test_software_project_bitbucket_data(self):
        root = get_root()
        software_collection = SoftwareCollection()
        root['software_collection'] = software_collection

        software_project = SoftwareProject(
                title="kotti_software Project",
                date_handling_choice="use_bitbucket_date",
                desc_handling_choice="use_bitbucket_description",
                bitbucket_owner="pypy",
                bitbucket_repo="pypy")

        software_collection['software_project'] = software_project

        assert len(software_collection.values()) == 1
Example #11
0
    def test_software_project_pypi_overwriting(self):
        root = get_root()
        software_collection = SoftwareCollection()
        root['software_collection'] = software_collection

        software_project = SoftwareProject(
            pypi_url="http://pypi.python.org/pypi/Kotti/json",
            overwrite_home_page_url=True,
            overwrite_docs_url=True,
            overwrite_package_url=True,
            overwrite_bugtrack_url=True,
            desc_handling_choice='use_pypi_summary')

        software_collection['software_project'] = software_project

        assert len(software_collection.values()) == 1

        # desc_handling_choice is an either/or,
        # so also check for description overwriting
        software_project = SoftwareProject(
            pypi_url="http://pypi.python.org/pypi/Kotti/json",
            desc_handling_choice='use_pypi_description')
Example #12
0
    def test_software_project_pypi_overwriting(self):
        root = get_root()
        software_collection = SoftwareCollection()
        root['software_collection'] = software_collection

        software_project = SoftwareProject(
                pypi_url="http://pypi.python.org/pypi/Kotti/json",
                overwrite_home_page_url=True,
                overwrite_docs_url=True,
                overwrite_package_url=True,
                overwrite_bugtrack_url=True,
                desc_handling_choice='use_pypi_summary')

        software_collection['software_project'] = software_project

        assert len(software_collection.values()) == 1

        # desc_handling_choice is an either/or,
        # so also check for description overwriting
        software_project = SoftwareProject(
                pypi_url="http://pypi.python.org/pypi/Kotti/json",
                desc_handling_choice='use_pypi_description')