コード例 #1
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
コード例 #2
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
コード例 #3
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
コード例 #4
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
コード例 #5
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
コード例 #6
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
コード例 #7
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
コード例 #8
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
コード例 #9
0
ファイル: test_views.py プロジェクト: geojeff/kotti_software
    def test_softwarecollection_view_no_project(self):

        root = get_root()
        softwarecollection = root['softwarecollection'] = SoftwareCollection()
        view = SoftwareCollectionView(root['softwarecollection'],
                                      DummyRequest()).view()

        assert view is not None

        assert ('items' in view) and (len(view['items']) == 0)

        assert ('settings' in view) \
                 and ('use_batching' in view['settings']) \
                 and (view['settings']['use_batching'] is True)
        assert ('settings' in view) \
                and ('pagesize' in view['settings']) \
                and (view['settings']['pagesize'] == 5)
        assert ('settings' in view) \
                and ('use_auto_batching' in view['settings']) \
                and (view['settings']['use_auto_batching'] is True)
        assert ('settings' in view) \
                and ('link_headline_overview' in view['settings']) \
                and (view['settings']['link_headline_overview'] is True)
        assert (('settings' in view) \
                 and ('use_batching' in view['settings']) \
                 and (view['settings']['use_batching'] is True))
コード例 #10
0
ファイル: test_views.py プロジェクト: geojeff/kotti_software
    def test_softwarecollection_view_adding_project(self):

        root = get_root()
        softwarecollection = root['softwarecollection'] = SoftwareCollection()
        view = SoftwareCollectionView(root['softwarecollection'],
                                      DummyRequest()).view()
        softwareproject = softwarecollection[
            'softwareproject'] = SoftwareProject()

        assert softwareproject is not None

        assert view is not None

        assert ('items' in view)

        batch = view['items']

        assert type(batch) is plone.batching.batch.BaseBatch

        assert ('api' in view) \
                and (type(view['api']) is kotti.views.util.TemplateAPI)

        assert ('settings' in view) \
                 and ('use_batching' in view['settings']) \
                 and (view['settings']['use_batching'] is True)
        assert ('settings' in view) \
                and ('pagesize' in view['settings']) \
                and (view['settings']['pagesize'] == 5)
        assert ('settings' in view) \
                and ('use_auto_batching' in view['settings']) \
                and (view['settings']['use_auto_batching'] is True)
        assert ('settings' in view) \
                and ('link_headline_overview' in view['settings']) \
                and (view['settings']['link_headline_overview'] is True)
コード例 #11
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
コード例 #12
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
コード例 #13
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')
コード例 #14
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')