def test_job_state_3_to_3(self):
     # DataValidation --> DataValidation
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 3
     with self.assertRaises(Exception):
         cognitive_job.state = 3
 def test_job_state_4_to_7(self):
     # InvalidData --> Completed
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 4
     with self.assertRaises(Exception):
         cognitive_job.state = 7
 def test_job_state_0_to_2(self):
     # Uninitialized --> InsufficientWorkers
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 0
     with self.assertRaises(Exception):
         cognitive_job.state = 2
 def test_job_state_5_to_5(self):
     # Cognition --> Cognition
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 5
     with self.assertRaises(Exception):
         cognitive_job.state = 5
 def test_job_state_6_to_6(self):
     # PartialResult --> PartialResult
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 6
     with self.assertRaises(Exception):
         cognitive_job.state = 6
 def test_job_state_0_to_7(self):
     # Uninitialized --> Completed
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 0
     with self.assertRaises(Exception):
         cognitive_job.state = 7
 def test_job_state_2_to_7(self):
     # InsufficientWorkers --> Completed
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 2
     with self.assertRaises(Exception):
         cognitive_job.state = 7
 def test_job_state_1_to_1(self):
     # GatheringWorkers --> GatheringWorkers
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 1
     with self.assertRaises(Exception):
         cognitive_job.state = 1
 def test_job_state_6_to_6(self):
     # PartialResult --> PartialResult
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 6
     assert cognitive_job.state == 6
 def test_job_state_5_to_5(self):
     # Cognition --> Cognition
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 5
     assert cognitive_job.state == 5
 def test_job_state_4_to_4(self):
     # InvalidData --> InvalidData
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 4
     assert cognitive_job.state == 4
 def test_job_state_3_to_3(self):
     # DataValidation --> DataValidation
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 3
     assert cognitive_job.state == 3
 def test_job_state_1_to_1(self):
     # GatheringWorkers --> GatheringWorkers
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 1
     assert cognitive_job.state == 1
 def test_job_state_2_to_2(self):
     # InsufficientWorkers --> InsufficientWorkers
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 2
     assert cognitive_job.state == 2
 def test_job_state_3_to_1(self):
     # DataValidation --> GatheringWorkers
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 3
     with self.assertRaises(Exception):
         cognitive_job.state = 1
 def test_job_state_4_to_2(self):
     # InvalidData --> InsufficientWorkers
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 4
     with self.assertRaises(Exception):
         cognitive_job.state = 2
 def test_job_state_5_to_4(self):
     # Cognition --> InvalidData
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 5
     with self.assertRaises(Exception):
         cognitive_job.state = 4
 def test_job_state_0_to_6(self):
     # Uninitialized --> PartialResult
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 0
     with self.assertRaises(Exception):
         cognitive_job.state = 6
 def test_job_state_6_to_7(self):
     # Cognition --> Completed
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 6
     with self.assertRaises(Exception):
         cognitive_job.state = 7
 def test_job_state_2_to_3(self):
     # InsufficientWorkers --> DataValidation
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 2
     with self.assertRaises(Exception):
         cognitive_job.state = 3
 def test_job_state_7_to_7(self):
     # Completed --> Completed
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 7
     with self.assertRaises(Exception):
         cognitive_job.state = 7
     # validate callbacks
     assert self.terminate_job_flag == 1
 def test_job_state_6_to_2(self):
     # PartialResult --> InsufficientWorkers
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 6
     with self.assertRaises(Exception):
         cognitive_job.state = 2
 def test_job_state_5_to_7(self):
     # Cognition --> Completed
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 5
     try:
         cognitive_job.state = 7
     except StateTransitionError as ex:
         pass
     assert cognitive_job.state == 7
 def test_job_state_5_to_6(self):
     # Cognition --> PartialResult
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 5
     try:
         cognitive_job.state = 6
     except StateTransitionError as ex:
         pass
     assert cognitive_job.state == 6
 def test_job_state_3_to_5(self):
     # DataValidation --> Cognition
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 3
     try:
         cognitive_job.state = 5
     except StateTransitionError as ex:
         pass
     assert cognitive_job.state == 5
 def test_job_state_0_to_1(self):
     # Uninitialized --> GatheringWorkers
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 0
     try:
         cognitive_job.state = 1
     except StateTransitionError:
         pass
     assert cognitive_job.state == 1
 def test_job_state_1_to_3(self):
     # GatheringWorkers --> DataValidation
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 1
     try:
         cognitive_job.state = 3
     except StateTransitionError as ex:
         pass
     assert cognitive_job.state == 3
 def test_job_state_1_to_2(self):
     # GatheringWorkers --> InsufficientWorkers
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self, contract_container='')
     cognitive_job.state = 1
     try:
         cognitive_job.state = 2
     except StateTransitionError as ex:
         pass
     assert cognitive_job.state == 2
 def test_job_state_7_to_7(self):
     # Completed --> Completed
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 7
     assert cognitive_job.state == 7
     # validate callbacks
     assert self.terminate_job_flag == 1
 def test_job_state_7_to_2(self):
     # Completed --> InsufficientWorkers
     self.reset_flags()
     cognitive_job = CognitiveJob(delegate=self,
                                  contract_container='',
                                  job_controller_container='')
     cognitive_job.state = 7
     with self.assertRaises(Exception):
         cognitive_job.state = 2
     # validate callbacks
     assert self.terminate_job_flag == 1