def __init__(self, log_executive=False, os_name=None, os_version=None, executive=None, filesystem=None, time_return_val=123): self.executable = 'python' self.executive = executive or MockExecutive(should_log=log_executive) self.filesystem = filesystem or MockFileSystem() self.user = MockUser() self.platform = MockPlatformInfo() if os_name: self.platform.os_name = os_name if os_version: self.platform.os_version = os_version # FIXME: Should this take pointers to the filesystem and the executive? self.workspace = MockWorkspace() self.stdin = StringIO() self.stdout = StringIO() self.stderr = StringIO() self.environ = { 'MOCK_ENVIRON_COPY': '1', 'PATH': '/bin:/mock/bin' } self.time_return_val = time_return_val
def __init__(self, log_executive=False, executive_throws_when_run=None, os_name=None, os_version=None, executive=None, filesystem=None): self.executable = 'python' self.executive = executive or MockExecutive( should_log=log_executive, should_throw_when_run=executive_throws_when_run) self.filesystem = filesystem or MockFileSystem() self.user = MockUser() self.platform = MockPlatformInfo() if os_name: self.platform.os_name = os_name if os_version: self.platform.os_version = os_version # FIXME: Should this take pointers to the filesystem and the executive? self.workspace = MockWorkspace() self.stdin = StringIO() self.stdout = StringIO() self.stderr = StringIO()
def __init__(self, log_executive=False, executive_throws_when_run=None): self.executive = MockExecutive( should_log=log_executive, should_throw_when_run=executive_throws_when_run) self.filesystem = MockFileSystem() self.user = MockUser() self.platform = MockPlatformInfo() # FIXME: Should this take pointers to the filesystem and the executive? self.workspace = MockWorkspace()