Exemple #1
0
from classroom import Classroom

room1 = Classroom('016', 80, ['PC', 'projector', 'mic'])
room2 = Classroom('007', 12, ['TV'])

# ['PC', 'projector', 'mic']
print(room1.equipment_differences(room2))

# Classroom(016, 80, ['PC', 'projector', 'mic'])
print(room1.__repr__())

# Classroom(007, 12, ['TV'])
print(room2.__repr__())

# False
print(room2.is_larger(room1))

# True
print(room1.is_larger(room2))

# ['PC', 'projector', 'mic']
print(room1.equipment_differences(room2))

# ['TV']
print(room2.equipment_differences(room1))

# Classroom 016 has a capacity of 80 persons and has the following
# equipment: PC, projector, mic
print(room1.__str__())

# Classroom 007 has a capacity of 12 persons and has the following
Exemple #2
0
from classroom import Classroom

classroom_016 = Classroom('016', 80, ['PC', 'projector', 'mic'])
classroom_007 = Classroom('007', 12, ['TV'])
print(classroom_016)
print(classroom_016.number)
print(classroom_016.capacity)
print(classroom_016.equipment)
print(classroom_016.is_larger(classroom_007))
print(classroom_016.equipment_differences(classroom_007))
print([classroom_016])
print(classroom_016)
Exemple #3
0
 def test_equipment_differences(self):
     classroom_016 = Classroom('016', 80, ['PC', 'projector', 'mic'])
     classroom_007 = Classroom('007', 12, ['TV', 'mic'])
     self.assertEqual(classroom_007.equipment_differences(classroom_016),
                      ['TV'])
Exemple #4
0
 def test_equipment_differences(self):
     self.assertEqual(
         Classroom.equipment_differences(classroom_016, classroom_007),
         ['PC', 'projector', 'mic'])