Commit d9fad8a9 authored by David Gobbi's avatar David Gobbi Committed by Marcus D. Hanwell
Browse files

ENH: Add python TestStrings and TestVariant to CMakeLists.txt

parent fbcd2826
......@@ -4,6 +4,8 @@
IF (VTK_PYTHON_EXE)
FOREACH ( tfile
PythonSmoke
TestStrings
TestVariant
TestWeakref
TestNumpySupport
TestTerminationCrash
......
......@@ -116,7 +116,7 @@ class TestVariant(Testing.vtkTest):
self.assertEqual(v.ToString(), '10')
def testCompare(self):
"""Use comparison operators to sort an array of vtkVariants"""
"""Use comparison operators to sort a list of vtkVariants"""
if not unicode_support:
return
l = map(vtk.vtkVariant, [1, 2.5, vtk.vtkVariant(), "0", u'hello'])
......@@ -124,6 +124,15 @@ class TestVariant(Testing.vtkTest):
l.sort()
self.assertEqual(l, s)
def testStrictWeakOrder(self):
"""Use vtkVariantStrictWeakOrder to sort a list of vtkVariants"""
if not unicode_support:
return
l = map(vtk.vtkVariant, [1, 2.5, vtk.vtkVariant(), "0", u'hello'])
s = map(vtk.vtkVariant, [vtk.vtkVariant(), 1, 2.5, "0", u'hello'])
l.sort(vtk.vtkVariantStrictWeakOrder)
self.assertEqual(l, s)
def testVariantExtract(self):
"""Use vtkVariantExtract"""
l = [1, '2', u'3', 4.0, vtk.vtkObject()]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment