def testFromRomanCase(self): """fromRoman should only accept uppercase input""" for integer in range(1, 4000): numeral = roman4.toRoman(integer) roman4.fromRoman(numeral.upper()) self.assertRaises(roman4.InvalidRomanNumeralError, roman4.fromRoman, numeral.lower())
def testToRomanKnownValues(self): """toRoman should give known result with known input""" for integer, numeral in self.knownValues: result = roman4.toRoman(integer) self.assertEqual(numeral, result)
def testToRomanCase(self): """toRoman should always return uppercase""" for integer in range(1, 4000): numeral = roman4.toRoman(integer) self.assertEqual(numeral, numeral.upper())
def testSanity(self): """fromRoman(toRoman(n))==n for all n""" for integer in range(1, 4000): numeral = roman4.toRoman(integer) result = roman4.fromRoman(numeral) self.assertEqual(integer, result)
def testToRomanCase(self): ##toRoman should be upperCase for integer in range(1, 4000): numeral = roman.toRoman(integer) self.assertEqual(numeral, numeral.upper())
def testToRomanKnownValues(self): for integer, numeral in self.knowValues: result = roman.toRoman(integer) self.assertEqual(numeral, result)