def test_int8_in(self): max = Number(self.MAX) min = Number(self.MIN) GIMarshallingTests.int8_in_max(max) GIMarshallingTests.int8_in_min(min) max.value += 1 min.value -= 1 self.assertRaises(ValueError, GIMarshallingTests.int8_in_max, max) self.assertRaises(ValueError, GIMarshallingTests.int8_in_min, min) self.assertRaises(TypeError, GIMarshallingTests.int8_in_max, "self.MAX")
def test_arg_exceptions(self): try: GIMarshallingTests.int8_in_max("fdsaf") except TypeError as e: self.assertTrue("1" in str(e)) self.assertTrue("'v'" in str(e)) self.assertTrue("int8_in_max" in str(e)) try: GIMarshallingTests.int8_in_max(10000) except OverflowError as e: self.assertTrue("1" in str(e)) self.assertTrue("'v'" in str(e)) self.assertTrue("int8_in_max" in str(e))
def test_arg_exceptions(self): try: GIMarshallingTests.int8_in_max("fdsaf") except TypeError as e: self.assertTrue("1" in str(e)) self.assertTrue("'v'" in str(e)) self.assertTrue("int8_in_max" in str(e)) try: GIMarshallingTests.int8_in_max(10000) except OverflowError as e: self.assertTrue("1" in str(e)) self.assertTrue("'v'" in str(e)) self.assertTrue("int8_in_max" in str(e))