

@raises(AzureStorageUploadError)
@patch('azurectl.storage.storage.PageBlob')
@patch('azurectl.storage.storage.XZ.open')
def test_upload_raises(self, mock_xz_open, mock_page_blob):
    stream = mock.Mock
    stream.close = mock.Mock()
    mock_xz_open.return_value = self
    mock_page_blob.side_effect = Exception
    self.storage.upload('../data/blob.xz')
    stream.close.assert_called_once_with()

dataset/ETHPy150Open SUSE/azurectl/test/unit/storage_storage_test.py TestStorage.test_upload_raises/VarMisuse@52/92 `stream`->`self`