def home_field(number): sum_of_rooms = 0 for i in range(number): a = input('Specify the length of the room {}'.format(i + 1)) if a == '' or a.isalpha(): print('tutaj') return home_field(number) else: a = int(a) b = input('Enter the width of the room {}'.format(i + 1)) if b == '' or b.isalpha(): print('tutaj') return home_field(number) else: b = int(b) sum_of_rooms += f.rectangle(a, b) return sum_of_rooms
def test_rectangle_with_correct_values(self): self.assertEqual(rectangle(self.a, self.b), 500)
def test_rectangle_with_incorrect_values(self): with self.assertRaises(ValueError): rectangle('***', self.b)
def test_rectangle_with_correct_values(self): result = rectangle(self.a, self.b) self.assertEqual(result, 20)
def test_rectangle_with_incorrect_value(self): with self.assertRaises(ValueError): rectangle(5, 'aaa')