コード例 #1
0
    def test_storage_settings_update_logging_blob(self,
                                                  mock_set_blob_properties):
        mock_storage_account = {
            "resourceGroup": "mock_resource_group",
            "name": "mock_storage_account",
            "properties": {
                "primaryEndpoints": {
                    "blob":
                    "https://cctstoragey6akyqpagdt3o.blob.core.windows.net/",
                    "queue":
                    "https://cctstoragey6akyqpagdt3o.queue.core.windows.net/",
                    "table":
                    "https://cctstoragey6akyqpagdt3o.table.core.windows.net/",
                    "file":
                    "https://cctstoragey6akyqpagdt3o.file.core.windows.net/"
                },
            }
        }
        mock_session = MagicMock()
        log_settings = MagicMock()

        StorageSettingsUtilities.update_logging(BLOB_TYPE,
                                                mock_storage_account,
                                                log_settings,
                                                session=mock_session)

        mock_set_blob_properties.assert_called_once()
コード例 #2
0
    def test_storage_settings_update_logging_blob(self, mock_set_blob_properties):
        mock_storage_account = {
            "resourceGroup": "mock_resource_group",
            "name": "mock_storage_account"
        }
        mock_token = 'mock_token'
        log_settings = MagicMock()

        StorageSettingsUtilities.update_logging(
            BLOB_TYPE, mock_storage_account, log_settings, token=mock_token)

        mock_set_blob_properties.assert_called_once()
コード例 #3
0
    def test_storage_settings_update_logging_table(self, mock_get_storage_key,
                                                   mock_set_table_properties):
        mock_storage_account = {
            "resourceGroup": "mock_resource_group",
            "name": "mock_storage_account"
        }
        mock_session = MagicMock()
        log_settings = MagicMock()

        StorageSettingsUtilities.update_logging(
            TABLE_TYPE, mock_storage_account, log_settings, session=mock_session)

        mock_get_storage_key.assert_called_with(
            'mock_resource_group', 'mock_storage_account', mock_session)
        mock_set_table_properties.assert_called_once()