def METHOD_NAME(self):
    """Test for modify_env function."""
    old_env_vars = {
        'TEST_ENV_VAR_TO_UNSET1': 'foobar',
        'TEST_ENV_VAR_TO_UNSET2': 'value does not matter',
        'TEST_COMMON_ENV_VAR_CHANGED': 'old_value',
        'TEST_COMMON_ENV_VAR_SAME_VALUE': 'this_value_stays',
    }
    new_env_vars = {
        'TEST_COMMON_ENV_VAR_CHANGED': 'new_value',
        'TEST_NEW_ENV_VAR1': '1',
        'TEST_NEW_ENV_VAR2': 'two 2 two',
        'TEST_COMMON_ENV_VAR_SAME_VALUE': 'this_value_stays',
    }
    # prepare test environment first:
    # keys in new_env should not be set yet, keys in old_env are expected to be set
    for key in new_env_vars:
        if key in os.environ:
            del os.environ[key]
    for key in old_env_vars:
        os.environ[key] = old_env_vars[key]
    env.modify_env(os.environ, new_env_vars)
    self.assertEqual(os.environ.get('TEST_ENV_VAR_TO_UNSET1'), None)
    self.assertEqual(os.environ.get('TEST_ENV_VAR_TO_UNSET2'), None)
    self.assertEqual(os.environ.get('TEST_COMMON_ENV_VAR_CHANGED'), 'new_value')
    self.assertEqual(os.environ.get('TEST_COMMON_ENV_VAR_SAME_VALUE'), 'this_value_stays')
    self.assertEqual(os.environ.get('TEST_NEW_ENV_VAR1'), '1')
    self.assertEqual(os.environ.get('TEST_NEW_ENV_VAR2'), 'two 2 two')
    # extreme test case: empty entire environment (original env is restored for next tests)
    env.modify_env(os.environ, {})