Ejemplo 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': {
                        'linux2_x86_64': {
                            'local_paths': ['/my/fake/adb/path'],
                        },
                    },
                },
            }, env_config.get('dependencies'))
Ejemplo n.º 2
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'))
Ejemplo n.º 3
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'))
Ejemplo n.º 4
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'))
Ejemplo n.º 5
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'))
Ejemplo n.º 6
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'))