def test_clear(self): t, s = cmds.sphere() cmds.select([t, s]) with ctx.selection(clear=True): self.assertFalse(cmds.ls(selection=True)) self.assertEqual(len(cmds.ls(selection=True)), 2)
def test_replace(self): t1, s1 = cmds.sphere() t2, s2 = cmds.sphere() cmds.select([t1, s1]) with ctx.selection([t2, s2], replace=True): self.assertEqual(sorted(cmds.ls(selection=True)), sorted([t2, s2])) self.assertEqual(sorted(cmds.ls(selection=True)), sorted([t1, s1]))