def test_initialized(self): try: ProcessContext.set_current_process(PROCESS_GC) self.assertEqual(PROCESS_GC, ProcessContext.get_current_process()) except AttributeError: self.assertTrue(False, 'get_current_process should return valid current_process')
def setUp(self): try: self.backup_process_name = ProcessContext.get_current_process() ProcessContext._current_process_name = '' except AttributeError: self.backup_process_name = None
def test_non_initialized(self): try: ProcessContext.get_current_process() self.assertTrue(False, 'get_current_process should throw an exception when current_process was not yet set') except AttributeError: self.assertTrue(True)