def test_varChange(self): parm = hou.parm("/obj/test_varChange/file1/file") string = "something_$VARCHANGE.bgeo" parm.set(string) path = parm.eval() self.assertEqual(path, string.replace("$VARCHANGE", "")) hou.setVariable("VARCHANGE", 22) hou.varChange() newPath = parm.eval() # Test the paths aren't the same. self.assertNotEqual(path, newPath) # Test the update was successful. self.assertEqual(newPath, string.replace("$VARCHANGE", "22"))
def test_unsetVariable(self): hou.setVariable("tester", 10) hou.unsetVariable("tester") self.assertTrue(hou.getVariable("tester") is None)
def test_setVariable(self): value = 22 hou.setVariable("awesome", value) self.assertEqual(hou.getVariable("awesome"), 22)