diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-12-08 20:47:09 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-12-08 20:47:09 (GMT) |
commit | cf11fcf862b98ef57935bcfccd6f2f6ae3f925f6 (patch) | |
tree | d7ae9d965b8eea03adfaf7a4d42907aae683d0f9 /tests/arch | |
parent | 48ac5e6e8fe50c1ff4b9e77440a6365f8b01021f (diff) |
Improved the way vmpa_t types are compared.
Diffstat (limited to 'tests/arch')
-rwxr-xr-x | tests/arch/vmpa.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/arch/vmpa.py b/tests/arch/vmpa.py index def61ea..09c3d9d 100755 --- a/tests/arch/vmpa.py +++ b/tests/arch/vmpa.py @@ -33,3 +33,29 @@ class TestVmpa(ChrysalideTestCase): self.assertEqual(a, b) self.assertEqual(a, c) + + + def testCompareWrong(self): + """Verify unhandled comparisons with VMPA.""" + + a = vmpa() + + with self.assertRaisesRegex(Exception, 'Unable to cast object as VMPA.'): + + self.assertLess(a, 'b') + + + def testCompareFair(self): + """Verify right VMPA comparisons.""" + + a = vmpa(0) + b = vmpa() + + self.assertLess(a, b) + + self.assertGreater(b, a) + + a = vmpa() + b = vmpa() + + self.assertEqual(a, b) |