# Repomd class
-Repomd = _createrepo_c.Repomd
+class Repomd(_createrepo_c.Repomd):
+ def __init__(self, path=None):
+ _createrepo_c.Repomd.__init__(self)
+ if path:
+ xml_parse_repomd(path, self)
# RepomdRecord class
def __init__(self, filename, compressiontype=GZ_COMPRESSION):
XmlFile.__init__(self, filename, XMLFILE_OTHER, compressiontype)
-# Methods
+# Functions
xml_dump_primary = _createrepo_c.xml_dump_primary
xml_dump_filelists = _createrepo_c.xml_dump_filelists
</data>
</repomd>
""")
+
+ def test_repomd_with_path_in_constructor_repo01(self):
+
+ repomd = cr.Repomd(REPO_01_REPOMD)
+ self.assertEqual(repomd.revision, "1334667230")
+ self.assertEqual(repomd.repo_tags, [])
+ self.assertEqual(repomd.distro_tags, [])
+ self.assertEqual(repomd.content_tags, [])
+ self.assertEqual(len(repomd.records), 3)
+