def test_wrong_argument_1(self): with self.assertRaises(ValueError): havana = City("Havana", 25, 70) havana.change_moisture("$")
def test_wrong_argument_3(self): with self.assertRaises(TypeError): havana = City("Havana", 25, 70) havana.change_moisture([1, 2, "sda"])
def test_moisture_change(self): havana = City("Havana", 25, 70) helsinki = City("Helsinki", -10, 50) havana.change_moisture(100) self.assertEqual(havana.get_moisture() - helsinki.get_moisture(), 50)