Beispiel #1
0
    def test_get_uor_doc(self):
        group_path = os.path.join(self.repo_root, 'groups', 'gr1')
        group = repounits.PackageGroup(group_path)

        doc = repoloadutil.get_uor_doc(group)
        exp_doc = repounits.UorDoc('GRoup 1 (gr1)',
                                   'Provide a test package group.')

        self.assertEqual(doc, exp_doc)

        group_path = os.path.join(self.repo_root, 'groups', 'gr2')
        group = repounits.PackageGroup(group_path)

        doc = repoloadutil.get_uor_doc(group)
        exp_doc = repounits.UorDoc('gr2', 'N/A')

        self.assertEqual(doc, exp_doc)
    def test_get_uor_doc(self):
        group_path = os.path.join(self.repo_root, 'groups', 'gr1')
        group = repounits.PackageGroup(group_path)

        doc = repoloadutil.get_uor_doc(group)
        exp_doc = repounits.UorDoc('GRoup 1 (gr1)',
                                   'Provide a test package group.')

        self.assertEqual(doc, exp_doc)

        group_path = os.path.join(self.repo_root, 'groups', 'gr2')
        group = repounits.PackageGroup(group_path)

        doc = repoloadutil.get_uor_doc(group)
        exp_doc = repounits.UorDoc('gr2', 'N/A')

        self.assertEqual(doc, exp_doc)
    def _load_uor_doc_and_versions(self):
        """Load the doc and version metadata for uors.

        Loading version numbers is done after loading other metadata because
        the version of one uor may refer to that of another.
        """

        uor_map = repocontextutil.get_uor_map(self.repo_context)

        for uor in uor_map.values():
            uor.doc = repoloadutil.get_uor_doc(uor)
            uor.version = repoloadutil.get_uor_version(uor, uor_map)