示例#1
0
 def test_dump(self):
     mmd = modulemd.ModuleMetadata()
     mmd.mdversion = 0
     mmd.name = "test"
     mmd.version = "1.23"
     mmd.release = "4"
     mmd.summary = "A test module"
     mmd.description = "This module is a part of the modulemd test suite."
     mmd.add_module_license("MIT")
     mmd.add_content_license("GPL+")
     mmd.add_content_license("GPLv3")
     mmd.add_buildrequires("example", "84-84")
     mmd.add_requires("modulemd", "42-42")
     mmd.community = "http://www.example.com/community"
     mmd.documentation = "http://www.example.com/documentation"
     mmd.tracker = "http://www.example.com/tracker"
     mmd.xmd = {"userid": "userdata"}
     mmd.profiles = {
         "default": modulemd.ModuleProfile(),
         "minimal": modulemd.ModuleProfile()
     }
     mmd.profiles["default"].rpms = set(["alfa", "alfa-subpackage"])
     mmd.profiles["minimal"].rpms = set(["alfa"])
     mmd.profiles[
         "minimal"].description = "Minimal profile installing only the alfa package."
     mmd.components = modulemd.ModuleComponents()
     mmd.components.rpms = modulemd.ModuleRPMs()
     mmd.components.rpms.dependencies = True
     mmd.components.rpms.add_api("alfa")
     mmd.components.rpms.add_api("alfa-extras")
     mmd.components.rpms.add_package("alfa", rationale="alfa rationale")
     mmd.components.rpms.add_package("bravo",
                                     rationale="bravo rationale",
                                     arches=["charlie", "delta"],
                                     multilib=["echo"],
                                     commit="foxtrot",
                                     repository="golf",
                                     cache="hotel")
     mmd.components.rpms.add_filter("filter_1")
     mmd.components.rpms.add_filter("filter_2")
     mmd.dump("tests/dump.yaml")
     self.test_load(filename="tests/dump.yaml")
示例#2
0
 def setUpClass(cls):
     cls.mmd = modulemd.ModuleMetadata()
     cls.mmd.name = "test"
     cls.mmd.version = "42"
     cls.mmd.release = "1"
     cls.mmd.summary = "A test module"
     cls.mmd.description = "It's only used for testing purposes."
     cls.mmd.module_licenses = set(["MIT"])
     cls.mmd.content_licenses = set(["ISC"])
     cls.mmd.buildrequires = {"builddepenency": "123-456"}
     cls.mmd.requires = {"dependency": "1.00-1"}
     cls.mmd.community = "http://www.example.com/community"
     cls.mmd.documentation = "http://www.example.com/documentation"
     cls.mmd.tracker = "http://www.example.com/tracker"
     cls.mmd.xmd = {"key": "value"}
     cls.mmd.profiles = {"default": modulemd.ModuleProfile()}
     cls.mmd.profiles["default"].rpms = set(["prof", "ile"])
     cls.mmd.profiles["default"].description = "Default set of packages"
     cls.mmd.components = modulemd.ModuleComponents()
     cls.mmd.components.rpms = modulemd.ModuleRPMs()
     cls.mmd.components.rpms.dependencies = True
     cls.mmd.components.rpms.api = set(["api"])
     cls.mmd.components.rpms.packages = {"rpm": {"rationale": ""}}
     cls.mmd.components.rpms.filter = set(["filter_1", "filter_2"])
示例#3
0
 def setUpClass(cls):
     cls.mr = modulemd.ModuleRPMs()
示例#4
0
 def test_dependencies_default(self):
     default = modulemd.ModuleRPMs()
     self.assertFalse(default.dependencies)