Ejemplo n.º 1
0
 def test_pod(self):
     """Validate we can save and load a PackageOrdererList to pod representation."""
     inst = PackageOrderList(
         (VersionSplitPackageOrder(Version("2.6.0")),
          PerFamilyOrder(order_dict={},
                         default_order=SortedOrder(descending=False))))
     self._test_pod(inst)
Ejemplo n.º 2
0
    def test_singleton_novalue(self):
        """Validate we can build a PackageOrderList object from empty configuration values."""
        config.override("package_orderers", None)

        # Clear @classproperty cache
        try:
            delattr(PackageOrderList, '_class_property_singleton')
        except AttributeError:
            pass

        self.assertEqual(PackageOrderList(), PackageOrderList.singleton)
Ejemplo n.º 3
0
    def test_singleton(self):
        """Validate we can build a PackageOrderList object from configuration values."""
        config.override("package_orderers", [{
            "type":
            "per_family",
            "orderers": [{
                "packages": ["python"],
                "type": "version_split",
                "first_version": "2.9.9"
            }]
        }])
        expected = PackageOrderList()
        expected.append(
            PerFamilyOrder(order_dict={
                "python": VersionSplitPackageOrder(Version("2.9.9"))
            }))

        # Clear @classproperty cache
        try:
            delattr(PackageOrderList, '_class_property_singleton')
        except AttributeError:
            pass
        self.assertEqual(expected, PackageOrderList.singleton)