Exemplo n.º 1
0
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
Exemplo n.º 2
0
 def test_rectangle_with_correct_values(self):
     self.assertEqual(rectangle(self.a, self.b), 500)
Exemplo n.º 3
0
 def test_rectangle_with_incorrect_values(self):
     with self.assertRaises(ValueError):
         rectangle('***', self.b)
Exemplo n.º 4
0
 def test_rectangle_with_correct_values(self):
     result = rectangle(self.a, self.b)
     self.assertEqual(result, 20)
Exemplo n.º 5
0
 def test_rectangle_with_incorrect_value(self):
     with self.assertRaises(ValueError):
         rectangle(5, 'aaa')