def test_when_registry_cpu_then_verify_registry_list_is_incremented(self): self.memory = Mock() self.interruptionManagerMock = Mock() cpu = Cpu(self.memory, self.interruptionManagerMock, self.lockPcbMock,self.irqQueueMock, self.lockIrqQueueMock, self.lockInstruction,'1') clock = Clock(self.lockProcessingMock) clock.registrycpu(cpu) self.assertEqual(len(clock.cpuList), 1)
def test_when_registry_cpu_then_verify_registry_list_is_incremented(self): self.memory = Mock() self.interruptionManagerMock = Mock() cpu = Cpu(self.memory, self.interruptionManagerMock, self.lockPcbMock, self.irqQueueMock, self.lockIrqQueueMock, self.lockInstruction, '1') clock = Clock(self.lockProcessingMock) clock.registrycpu(cpu) self.assertEqual(len(clock.cpuList), 1)
def test_when_tick_then_call_cpu_fetch(self): cpu = Mock() clock = Clock(self.lockProcessingMock) clock.registrycpu(cpu) clock.tick() self.assertEqual(cpu.fetch.called, True)
def createElement(self, lockProcessing): clock = Clock(lockProcessing) return clock