def testFromRomanCase(self): """fromRoman should only accept uppercase input""" for integer in range(1, 5000): numeral = roman1.toRoman(integer) roman1.fromRoman(numeral.upper()) self.assertRaises(roman1.InvalidRomanNumeralError, roman1.fromRoman, numeral.lower())
def testSanity(self): """fromRoman(toRoman(n)) == n for all n""" for integer in range(1, 5000): numeral = roman1.toRoman(integer) result = roman1.fromRoman(numeral) self.assertEqual(integer, result)
def testFromRomanKnownValues(self): """fromRoman should give known result with known input""" for integer, numeral in self.knownValues: result = roman1.fromRoman(numeral) self.assertEqual(integer, result)
def testSanity(self): """fromRoman(toRoman(n))==n for all n""" for integer in range(1, 5000): numeral = roman1.toRoman(integer) result = roman1.fromRoman(numeral) self.assertEqual(integer, result)