def test_major_minor_release_build(self):
     pkg = {
         "product": "foo-bar",
         "major_version": "1",
         "minor_version": "3",
         "release_version": "62",
         "build_version": "876"
     }
     expected = "foo-bar 1.3.62.876"
     self.assertEqual(ptree.to_name(pkg), expected)
 def test_major_only(self):
     pkg = {
         "product": "foo-bar",
         "major_version": "1",
         "minor_version": "",
         "release_version": "",
         "build_version": ""
     }
     expected = "foo-bar 1"
     self.assertEqual(ptree.to_name(pkg), expected)
def update(obj, data_block):
    """
    Rebuilds the clarisse_version menu.

    Args:
        obj (ConductorJob): Item on which to rebuild menu.
        data_block (ConductorDataBlock): Singleton object containing software package data.
    """

    clarisse_version_att = obj.get_attribute("clarisse_version")
    tree_data = data_block.package_tree().tree
    names = sorted([str(pt.to_name(t)) for t in tree_data["children"]])
    for i, name in enumerate(names):
        clarisse_version_att.add_preset(name, str(i))
Esempio n. 4
0
    def _build_ui(self, tree_data, parent_item):
        for child_tree in tree_data["children"]:
            name = str(pt.to_name(child_tree))
            child_tree_item = PackageTreeItem(parent_item, name)

            if parent_item == self.root_item:
                self.child_list.append(child_tree_item)
            else:
                parent_item.child_list.append(child_tree_item)

            self._build_ui(child_tree, child_tree_item)

        if tree_data["children"]:
            parent_item.set_expandable(True)
            parent_item.expand()
 def test_find_plugin_level_high_limit(self):
     name = "arnold-houdini 2.0.2.2"
     result = self.pt.find_by_name(name, 2)
     self.assertEqual(ptree.to_name(result), name)
 def test_find_root_when_limit_1(self):
     name = 'houdini 16.5.323'
     result = self.pt.find_by_name(name, 1)
     self.assertEqual(ptree.to_name(result), name)
 def test_find_leaf_path(self):
     path = "houdini 16.0.736/arnold-houdini 2.0.2.2/al-shaders 1.0"
     pkg = self.pt.find_by_path(path)
     self.assertEqual(ptree.to_name(pkg), "al-shaders 1.0")
 def test_find_root_path(self):
     path = "houdini 16.0.736"
     pkg = self.pt.find_by_path(path)
     self.assertEqual(ptree.to_name(pkg), path)