Beispiel #1
0
 def test_bundle_from_properties(self):
     props = {"osgi.id": "bundle.name", "osgi.version": "1"}
     b = OSGiBundle.from_properties(props)
     self.assertEqual(b.bundle, "bundle.name")
     self.assertEqual(b.version, "1")
     self.assertEqual(b.namespace, "")
     self.assertEqual(b.get_rpm_str(), "osgi(bundle.name) = 1")
     self.assertEqual(len(b.requires), 0)
Beispiel #2
0
 def test_bundle_from_properties(self):
     props = {"osgi.id": "bundle.name", "osgi.version": "1"}
     b = OSGiBundle.from_properties(props)
     self.assertEqual(b.bundle, "bundle.name")
     self.assertEqual(b.version, "1")
     self.assertEqual(b.namespace, "")
     self.assertEqual(b.get_rpm_str(), "osgi(bundle.name) = 1")
     self.assertEqual(len(b.requires), 0)
Beispiel #3
0
    def test_bundle_from_properties_complex(self):
        props = {"osgi.id": "bundle.name",
                 "osgi.version": "1",
                 "osgi.requires": "req1.abc,req2(ns2)",
                 "osgi.namespace": "ns1"
                 }
        b = OSGiBundle.from_properties(props)
        self.assertEqual(b.bundle, "bundle.name")
        self.assertEqual(b.version, "1")
        self.assertEqual(b.namespace, "ns1")
        self.assertEqual(b.get_rpm_str(), "ns1-osgi(bundle.name) = 1")
        self.assertEqual(len(b.requires), 2)

        self.assertEqual(b.requires[0].bundle, "req1.abc")
        self.assertEqual(b.requires[0].namespace, "")
        self.assertEqual(b.requires[0].get_rpm_str(), "osgi(req1.abc)")

        self.assertEqual(b.requires[1].bundle, "req2")
        self.assertEqual(b.requires[1].namespace, "ns2")
        self.assertEqual(b.requires[1].get_rpm_str(), "ns2-osgi(req2)")
Beispiel #4
0
    def test_bundle_from_properties_complex(self):
        props = {
            "osgi.id": "bundle.name",
            "osgi.version": "1",
            "osgi.requires": "req1.abc,req2(ns2)",
            "osgi.namespace": "ns1"
        }
        b = OSGiBundle.from_properties(props)
        self.assertEqual(b.bundle, "bundle.name")
        self.assertEqual(b.version, "1")
        self.assertEqual(b.namespace, "ns1")
        self.assertEqual(b.get_rpm_str(), "ns1-osgi(bundle.name) = 1")
        self.assertEqual(len(b.requires), 2)

        self.assertEqual(b.requires[0].bundle, "req1.abc")
        self.assertEqual(b.requires[0].namespace, "")
        self.assertEqual(b.requires[0].get_rpm_str(), "osgi(req1.abc)")

        self.assertEqual(b.requires[1].bundle, "req2")
        self.assertEqual(b.requires[1].namespace, "ns2")
        self.assertEqual(b.requires[1].get_rpm_str(), "ns2-osgi(req2)")
Beispiel #5
0
 def get_osgi_bundle(self):
     if not self.properties:
         return None
     return OSGiBundle.from_properties(self.properties)
Beispiel #6
0
 def get_osgi_bundle(self):
     if not self.properties:
         return None
     return OSGiBundle.from_properties(self.properties)