Esempio n. 1
0
    def test_multiple_ints_with_conversion_good_values(self):
        self.assertEqual(multiple_ints_with_conversion(6, 0), 0)
        self.assertEqual(multiple_ints_with_conversion(12, 2), 24)

        self.assertEqual(multiple_ints_with_conversion(6, "2"), 12)
        self.assertEqual(multiple_ints_with_conversion("12", 2), 24)

        self.assertEqual(multiple_ints_with_conversion(True, 2), 2)
Esempio n. 2
0
 def test_multiple_ints_with_conversion_invalid_values(self):
     with self.assertRaises(ValueError):
         multiple_ints_with_conversion("Some useful text from your teacher",
                                       2)
         multiple_ints_with_conversion([12, 6, 98], 2)