def test_delete(self, mock_swift, mock_logger): store = SwiftStore(mock_swift, TIER_1, mock_logger) mock_swift.delete_object.return_value = None store.delete(self.user_id, self.uuid, container="anan", path_format=self.path_format) self.assertRaises(None)
def test_delete_client_exception(self, mock_swift, mock_logger): store = SwiftStore(mock_swift, TIER_1, mock_logger) mock_swift.delete_object.side_effect = ClientException("delete failed") with self.assertRaises(ClientException) as ar: store.delete(self.user_id, self.uuid, container="anan", path_format=self.path_format) self.assertIsInstance(ar.exception, ClientException)