telemetry.testing.system_stub | index telemetry/testing/system_stub.py

`Provides stubs for os, sys and subprocess for testing
This test allows one to test code that itself uses os, sys, and subprocess.`

Modules
`` |  |

ntpath os | posixpath re | shlex sys |

Classes
`` |  |

__builtin__.object
  AdbDevice
  AdbInstallCertStub
  CertUtilsStub
  CloudStorageModuleStub
  LoggingStub
  OpenFunctionStub
  OsModuleStub
  Override
  PerfControlModuleStub
  PlatformSettingsStub
  RawInputFunctionStub
  SubprocessModuleStub
  SysModuleStub
  ThermalThrottleModuleStub

class AdbDevice(__builtin__.object)
`` |  | Methods defined here:

FileExists(self, _)

GetProp(self, property_name)

HasRoot(self)

NeedsSU(self)

ReadFile(self, device_path, as_root=False)

RunShellCommand(self, args, **_kwargs)

SetProp(self, property_name, property_value)

__init__(self)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class AdbInstallCertStub(__builtin__.object)
`` |  | Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes defined here:

AndroidCertInstaller = <class 'telemetry.testing.system_stub.AndroidCertInstaller'>

class CertUtilsStub(__builtin__.object)
`` |  | Static methods defined here:

generate_dummy_ca_cert()

write_dummy_ca_cert(_ca_cert_str, _key_str, cert_path)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes defined here:

openssl_import_error = None

class CloudStorageModuleStub(__builtin__.object)
`` |  | Methods defined here:

CalculateHash(self, file_path)

ChangeRemoteHashForTesting(self, bucket, remote_path, new_hash)

CheckPermissionLevelForBucket(self, bucket)

Exists(self, bucket, remote_path)

Get(self, bucket, remote_path, local_path)

GetFilesInDirectoryIfChanged(self, directory, bucket)

GetHelper(self, bucket, remote_path, local_path, only_if_changed)

GetIfChanged(self, local_path, bucket=None)

GetLocalDataFiles(self)

GetLocalHashFiles(self)

GetRemotePathsForTesting(self)

Insert(self, bucket, remote_path, local_path)

List(self, bucket)

ReadHash(self, hash_path)

SetCalculatedHashesForTesting(self, calculated_hash_dictionary)
  `# Set a dictionary of data files and their "calculated" hashes.`

SetHashFileContentsForTesting(self, hash_file_dictionary)
  `# Set a dictionary of hash files and the hashes they should contain.`

SetPermissionLevelForTesting(self, permission_level)

SetRemotePathsForTesting(self, remote_path_dict=None)

__init__(self)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes defined here:

BUCKET_ALIASES = {'internal': 'chrome-telemetry', 'partner': 'chrome-partner-telemetry', 'public': 'chromium-telemetry'}

CREDENTIALS_ERROR_PERMISSION = -1

CloudStorageError = <class 'telemetry.testing.system_stub.CloudStorageError'>

CredentialsError = <class 'telemetry.testing.system_stub.CredentialsError'>

INTERNAL_BUCKET = 'chrome-telemetry'

INTERNAL_PERMISSION = 2

NotFoundError = <class 'telemetry.testing.system_stub.NotFoundError'>

PARTNER_BUCKET = 'chrome-partner-telemetry'

PARTNER_PERMISSION = 1

PUBLIC_BUCKET = 'chromium-telemetry'

PUBLIC_PERMISSION = 0

PermissionError = <class 'telemetry.testing.system_stub.PermissionError'>

class LoggingStub(__builtin__.object)
`` |  | Methods defined here:

__init__(self)

error(self, msg, *args)

info(self, msg, *args)

warn(self, msg, *args)

warning(self, msg, *args)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class OpenFunctionStub(__builtin__.object)
`` |  | Methods defined here:

__call__(self, name, *args, **kwargs)

__init__(self)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes defined here:

FileStub = <class 'telemetry.testing.system_stub.FileStub'>

class OsModuleStub(__builtin__.object)
`` |  | Methods defined here:

__init__(self, sys_module=<module 'sys' (built-in)>)

access(self, path, _)

chdir(self, path)

getenv(self, name, value=None)

walk(self, top)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes defined here:

OsEnvironModuleStub = <class 'telemetry.testing.system_stub.OsEnvironModuleStub'>

OsPathModuleStub = <class 'telemetry.testing.system_stub.OsPathModuleStub'>

X_OK = 1

pathsep = ':'

sep = '/'

class Override(__builtin__.object)
`` |  | Methods defined here:

Restore(self)

__del__(self)

__init__(self, base_module, module_list)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class PerfControlModuleStub(__builtin__.object)
`` |  | Methods defined here:

__init__(self)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes defined here:

PerfControlStub = <class 'telemetry.testing.system_stub.PerfControlStub'>

class PlatformSettingsStub(__builtin__.object)
`` |  | Static methods defined here:

HasSniSupport()

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class RawInputFunctionStub(__builtin__.object)
`` |  | Methods defined here:

__call__(self, name, *args, **kwargs)

__init__(self)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class SubprocessModuleStub(__builtin__.object)
`` |  | Methods defined here:

__init__(self)

call(self, *args, **kwargs)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes defined here:

PopenStub = <class 'telemetry.testing.system_stub.PopenStub'>

class SysModuleStub(__builtin__.object)
`` |  | Methods defined here:

__init__(self)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class ThermalThrottleModuleStub(__builtin__.object)
`` |  | Methods defined here:

__init__(self)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes defined here:

ThermalThrottleStub = <class 'telemetry.testing.system_stub.ThermalThrottleStub'>