def test_qiime_config_variable(variable, qiime_config, test, access_var=R_OK, fail_on_missing=False):
 fp = qiime_config[variable]
 if (not fp):
  if fail_on_missing:
   test.fail(('%s not set.' % variable))
  else:
   return
 test.assertTrue(exists(fp), ('%s set to an invalid file path: %s' % (variable, fp)))
 modes = {R_OK: 'readable', W_OK: 'writable', X_OK: 'executable'}
 test.assertTrue(access(fp, access_var), ('%s is not %s: %s' % (variable, modes[access_var], fp)))

def test_qiime_config_variable ( variable , qiime_config , test , access_var = R_OK , fail_on_missing = False ) : fp = qiime_config [ variable ] if ( not fp ) : if fail_on_missing : test . fail ( ( '%s not set.' % variable ) ) else : return test . assertTrue ( exists ( fp ) , ( '%s set to an invalid file path: %s' % ( variable , fp ) ) ) modes = { R_OK : 'readable' , W_OK : 'writable' , X_OK : 'executable' } test . assertTrue ( access ( fp , access_var ) , ( '%s is not %s: %s' % ( variable , modes [ access_var ] , fp ) ) )
test if a variable is set and set to a readable path .