Esempio n. 1
0
  def testGetEnvironmentVariableConfig_adbPath(self):
    def mock_environment(env_var):
      return '/my/fake/adb/path' if env_var == 'ADB_PATH' else None

    with mock.patch('os.environ.get',
                    mock.Mock(side_effect=mock_environment)):
      env_config = devil_env._GetEnvironmentVariableConfig()
    self.assertEquals(
        {
          'adb': {
            'file_info': {
              'linux_x86_64': {
                'local_paths': ['/my/fake/adb/path'],
              },
            },
          },
        },
        env_config.get('dependencies'))
Esempio n. 2
0
 def testGetEnvironmentVariableConfig_noEnv(self):
   with mock.patch('os.environ.get',
                   mock.Mock(side_effect=lambda _env_var: None)):
     env_config = devil_env._GetEnvironmentVariableConfig()
   self.assertEquals({}, env_config.get('dependencies'))
Esempio n. 3
0
 def testGetEnvironmentVariableConfig_configType(self):
   with mock.patch('os.environ.get',
                   mock.Mock(side_effect=lambda _env_var: None)):
     env_config = devil_env._GetEnvironmentVariableConfig()
   self.assertEquals('BaseConfig', env_config.get('config_type'))