Exemple #1
0
 def mock_get_database_account(self, url_connection=None):
     database_account = documents.DatabaseAccount()
     database_account._EnableMultipleWritableLocations = True
     database_account._WritableLocations = [{
         'name':
         self.WRITE_ENDPOINT_NAME1,
         'databaseAccountEndpoint':
         self.WRITE_ENDPOINT1
     }, {
         'name':
         self.WRITE_ENDPOINT_NAME2,
         'databaseAccountEndpoint':
         self.WRITE_ENDPOINT2
     }]
     database_account._ReadableLocations = [{
         'name':
         self.READ_ENDPOINT_NAME1,
         'databaseAccountEndpoint':
         self.READ_ENDPOINT1
     }, {
         'name':
         self.READ_ENDPOINT_NAME2,
         'databaseAccountEndpoint':
         self.READ_ENDPOINT2
     }]
     return database_account
 def create_database_account(self, use_multiple_write_locations):
     database_account = documents.DatabaseAccount()
     database_account._EnableMultipleWritableLocations = use_multiple_write_locations
     database_account._WritableLocations = [
                 {'name': 'location1', 'databaseAccountEndpoint': self.LOCATION_1_ENDPOINT},
                 {'name': 'location2', 'databaseAccountEndpoint': self.LOCATION_2_ENDPOINT},
                 {'name': 'location3', 'databaseAccountEndpoint': self.LOCATION_3_ENDPOINT}
                 ]
     database_account._ReadableLocations = [
                 {'name': 'location1', 'databaseAccountEndpoint': self.LOCATION_1_ENDPOINT},
                 {'name': 'location2', 'databaseAccountEndpoint': self.LOCATION_2_ENDPOINT},
                 {'name': 'location4', 'databaseAccountEndpoint': self.LOCATION_4_ENDPOINT}
                 ]
     return database_account
    def GetDatabaseAccount1(self):
        database_account = documents.DatabaseAccount()
        database_account._ReadableLocations = [{
            'name':
            Test_globaldb_mock_tests.read_location,
            'databaseAccountEndpoint':
            Test_globaldb_mock_tests.read_location_host
        }]
        database_account._WritableLocations = [{
            'name':
            Test_globaldb_mock_tests.write_location,
            'databaseAccountEndpoint':
            Test_globaldb_mock_tests.write_location_host
        }]

        return database_account
Exemple #4
0
 def _MockGetDatabaseAccount(self, url_conection):
     database_account = documents.DatabaseAccount()
     return database_account