コード例 #1
0
ファイル: test_classroom.py プロジェクト: tolik0/Lab_3
 def test_str(self):
     classroom_007 = Classroom('007', 12, ['TV'])
     self.assertEqual(
         classroom_007.__str__(),
         "Classroom 007 has a capacity of 12 persons and has "
         "the following equipment: TV.")
コード例 #2
0
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
# equipment: TV
print(room2.__str__())
コード例 #3
0
ファイル: test_classroom.py プロジェクト: H4wking/lab5
    def test___str__(self):
        self.assertEqual(
            Classroom.__str__(classroom_016),
            "Classroom 016 has a capacity of 80 persons and has the \
following equipment: PC, projector, mic.")