def test_setModifierOutOfBounds(self): session1 = scrap.Modifier() newModifier = random.randint(-999, -10) with self.assertRaises(OverflowError): session1.setModifier(newModifier) newModifier = random.randint(31, 999) with self.assertRaises(OverflowError): session1.setModifier(newModifier)
def test_getModifier(self): session1 = scrap.Modifier(2) self.assertEqual(session1.getModifier(), 2)
def test_setModifierString(self): session1 = scrap.Modifier() newModifier = 'a' with self.assertRaises(ValueError): session1.setModifier(newModifier)
def test_setModifierNegative(self): session1 = scrap.Modifier() newModifier = -1 session1.setModifier(newModifier) self.assertEqual(newModifier, session1.getModifier())