本文整理汇总了Python中machine.Machine.finish_repair方法的典型用法代码示例。如果您正苦于以下问题:Python Machine.finish_repair方法的具体用法?Python Machine.finish_repair怎么用?Python Machine.finish_repair使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类machine.Machine
的用法示例。
在下文中一共展示了Machine.finish_repair方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestMachine
# 需要导入模块: from machine import Machine [as 别名]
# 或者: from machine.Machine import finish_repair [as 别名]
class TestMachine(unittest.TestCase):
def setUp(self):
Machine.available = []
self.machine = Machine(1, 'Janome', ['overlock', 'zig-zag', 'costura reta'])
def test_startup_machine(self):
self.machine.code |should| equal_to(1)
self.machine.producer |should| equal_to('Janome')
self.machine.sewing_types |should| equal_to(['overlock', 'zig-zag', 'costura reta'])
self.machine.repairing |should| equal_to(False)
self.machine.repairs |should| equal_to([])
Machine.available |should| equal_to([self.machine])
def test_repair_machine(self):
self.machine.repair('supervisor', '16-10-2012')
self.machine.repairing |should| equal_to(True)
self.machine.repairs |should| equal_to([{'supervisor': 'supervisor', 'initiate': '16-10-2012'}])
Machine.available |should_not| contain(self.machine)
(self.machine.repair, 'supervisor2', '17-10-2012') |should| throw(MachineInRepair)
def test_finish_repair_machine(self):
self.machine.repair('supervisor', '16-10-2012')
self.machine.finish_repair('17-10-2012')
self.machine.repairs |should| equal_to([{'supervisor': 'supervisor', 'initiate': '16-10-2012', 'end': '17-10-2012'}])
self.machine.repairing |should| equal_to(False)
Machine.available |should| contain(self.machine)
(self.machine.finish_repair, '17-10-2012') |should| throw(MachineNotInRepair)
def test_problematic_machine(self):
for i in range(11):
self.machine.repair('supervisor', '16-10-2012')
self.machine.finish_repair('17-10-2012')
len(self.machine.repairs) |should| equal_to(11)
Machine.problematic_machines |should| contain(self.machine)
def test_machines_avaiable(self):
Machine.available_machines() |should| equal_to('producer: Janome sewing types: overlock, zig-zag, costura reta')