def test_any_change_should_call_call_back(self):
     status = MachineStatus(status_call_back = self.call_back)
     self.assertEquals(0,self.call_count)
     status.set_not_waiting_for_drips()
     self.assertEquals(1,self.call_count)
     status.set_waiting_for_drips()
     self.assertEquals(2,self.call_count)
     status.drip_call_back(1,1)
     self.assertEquals(3,self.call_count)
     status.add_layer()
     self.assertEquals(4,self.call_count)
     status.add_error(MachineError("whooops"))
     self.assertEquals(5,self.call_count)
     status.set_complete()
     self.assertEquals(6,self.call_count)
Esempio n. 2
0
 def test_any_change_should_call_call_back(self):
     status = MachineStatus(status_call_back = self.call_back)
     self.assertEquals(0,self.call_count)
     status.set_not_waiting_for_drips()
     self.assertEquals(1,self.call_count)
     status.set_waiting_for_drips()
     self.assertEquals(2,self.call_count)
     status.drip_call_back(1,1,1)
     self.assertEquals(3,self.call_count)
     status.add_layer()
     self.assertEquals(4,self.call_count)
     status.add_error(MachineError("whooops"))
     self.assertEquals(5,self.call_count)
     status.set_complete()
     self.assertEquals(6,self.call_count)
 def test_once_complete_drips_or_layers_dont_change_status(self):
     status = MachineStatus()
     status.set_complete()
     status.add_layer()
     status.drip_call_back(45,10)
     self.assertEqual('Complete',status.status()['status'])
 def test_status_is_running_after_first_layer(self):
     status = MachineStatus()
     status.add_layer()
     self.assertEqual('Running',status.status()['status'])
    def test_add_layer_adds_a_layer(self):
        status = MachineStatus()
        status.add_layer()

        self.assertEqual(1,status.status()['current_layer'])
Esempio n. 6
0
 def test_once_complete_drips_or_layers_dont_change_status(self):
     status = MachineStatus()
     status.set_complete()
     status.add_layer()
     status.drip_call_back(45,10,12)
     self.assertEqual('Complete',status.status()['status'])
Esempio n. 7
0
 def test_status_is_running_after_first_layer(self):
     status = MachineStatus()
     status.add_layer()
     self.assertEqual('Running',status.status()['status'])
Esempio n. 8
0
    def test_add_layer_adds_a_layer(self):
        status = MachineStatus()
        status.add_layer()

        self.assertEqual(1,status.status()['current_layer'])