def test_get_environment(self): """ rapid-unit: Rapid Client:Remote Execution:Can remotely execute code on client :return: :rtype: """ executor = Executor( WorkRequest({ 'action_instance_id': 1, 'pipeline_instance_id': 2, 'environment': { 'Something': 'More' } }), None) environment = os.environ environment.update({ 'Something': 'More', 'action_instance_id': '1', 'pipeline_instance_id': '2', 'PYTHONUNBUFFERED': 'true' }) test = executor.get_environment() eq_('More', executor.get_environment()['Something']) eq_('1', executor.get_environment()['action_instance_id']) eq_('2', executor.get_environment()['pipeline_instance_id']) eq_('true', executor.get_environment()['PYTHONUNBUFFERED'])
def test_get_environment_with_unicode_bytes(self): executor = Executor(Mock(environment={b'Testing': u'\u2013 Trial and Error'}), None) self.assertEqual('– Trial and Error', executor.get_environment()['Testing'])