schrodinger.test.ld_mock_modules module¶
- class schrodinger.test.ld_mock_modules.MockLogin(host='https://unit_test-8-5.dev.bb.schrodinger.com')[source]¶
Bases:
object
A mock of the
applications.livedesign.login
module for use in testing.- HOST = 'host'¶
- USERNAME = 'username'¶
- CLIENT = 'client'¶
- MODELS = 'models'¶
- VERSION_NUMBER = 'seurat_version_number'¶
- COMPATIBILITY_MODE = 'compatibility_mode'¶
- LD_MODE = 'LIVEDESIGN_MODE'¶
- LDCLIENT_PATH = '/livedesign/ldclient.tar.gz'¶
- API_PATH = '/livedesign/api'¶
- GLOBAL_PROJECT_ID = '0'¶
- LD_VERSION_CORP_ID_MATCHING = Version(major=8, minor=1)¶
- LD_VERSION_MULTIPLE_IDS = Version(major=8, minor=1)¶
- LD_VERSION_REAL_VIRTUAL = Version(major=8, minor=2)¶
- LD_VERSION_NEW_EXPORT = Version(major=8, minor=7)¶
- LD_VERSION_NEW_IMPORT = Version(major=8, minor=9)¶
- LD_VERSION_POSE_NAMES = Version(major=8, minor=9)¶
- LD_VERSION_COMPATIBILITY_MODE = Version(major=8, minor=10)¶
- LD_VERSION_3D_PROTOCOL = Version(major=9, minor=1)¶
- VERSION_MISMATCH_MSG = 'There is a mismatch between the client version and the server version. Please try restarting Maestro.'¶
- INVALID_CREDENTIALS_MSG = 'Invalid username or password.'¶
- INVALID_TOKEN_MSG = 'Invalid token.'¶
- IMPORT_ERROR_MSG = 'Could not successfully import the necessary files fetched from the server.'¶
- CONTACT_SUPPORT_MSG = '\nPlease contact Schrodinger Technical Support with the hostname used to login.'¶
- NO_CONNECTION_MSG = 'Cannot connect to specified host.'¶
- class Version(major, minor)¶
Bases:
tuple
- __contains__(key, /)¶
Return key in self.
- __len__()¶
Return len(self).
- count(value, /)¶
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.
- major¶
Alias for field number 0
- minor¶
Alias for field number 1
- get_ld_client_and_models()[source]¶
Return the stored
ldclient.client.LDClient
andldclient.models
mocks.Providing the same
LDClient
instance every time allows modifications to the “server state” (actually stored on theLDClient
mock) made in unit tests to be reflected in the modules in whichlogin
has been patched out withMockLogin
.
- get_LD_version(ld_client=None)[source]¶
- Parameters
ld_client (mock.Mock) – a mock of the
client.LDClient
class, with a properly-behavingabout()
method defined (optional)- Returns
the version of the supplied LD client instance
- Return type
- get_LD_mode(ld_client)[source]¶
- Parameters
ld_client (mock.Mock) – a mock of the
client.LDClient
class, with amode
attribute defined- Returns
the LD mode of supplied LD client instance; expect to be a string representations of one of the values of
login.LDMode
- Return type
str