mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 18:08:58 +00:00
Bug 1267454 - Set up a mock-able import for os.environ in configure tests. r=glandium
MozReview-Commit-ID: AtkkLC5xEip
This commit is contained in:
parent
463051b415
commit
a91638058c
@ -4,6 +4,7 @@
|
||||
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
import copy
|
||||
import errno
|
||||
import os
|
||||
import subprocess
|
||||
@ -74,6 +75,7 @@ class ConfigureTestSandbox(ConfigureSandbox):
|
||||
environ['CONFIG_SHELL'] = mozpath.abspath('/bin/sh')
|
||||
self._subprocess_paths[environ['CONFIG_SHELL']] = self.shell
|
||||
paths.append(environ['CONFIG_SHELL'])
|
||||
self._environ = copy.copy(environ)
|
||||
|
||||
vfs = ConfigureTestVFS(paths)
|
||||
|
||||
@ -107,6 +109,9 @@ class ConfigureTestSandbox(ConfigureSandbox):
|
||||
Popen=self.Popen,
|
||||
)
|
||||
|
||||
if what == 'os.environ':
|
||||
return self._environ
|
||||
|
||||
return super(ConfigureTestSandbox, self)._get_one_import(what)
|
||||
|
||||
def which(self, command, path=None):
|
||||
|
Loading…
Reference in New Issue
Block a user