Skip to content

Commit

Permalink
RDBC-670 RavenDB_16321Test::streamingOnIndexThatDoesNotExistShouldThrow
Browse files Browse the repository at this point in the history
  • Loading branch information
poissoncorp committed Mar 2, 2023
1 parent ab3ecd1 commit fded084
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ravendb/documents/session/operations/stream.py
Expand Up @@ -65,7 +65,7 @@ def create_request(self, query: IndexQuery) -> QueryStreamCommand:
# return StreamCommand("".join(sb))

def set_result(self, response: StreamResultResponse) -> Iterator[Dict]:
if response.stream_iterator is None:
if response is None or response.stream_iterator is None:
raise IndexDoesNotExistException("The index does not exists, failed to stream results")

parser = JSONLRavenStreamParser(response.stream_iterator)
Expand Down
@@ -0,0 +1,16 @@
from ravendb.documents.queries.misc import Query
from ravendb.exceptions.exceptions import IndexDoesNotExistException
from ravendb.tests.test_base import TestBase


class TestRavenDB16321(TestBase):
def setUp(self):
super(TestRavenDB16321, self).setUp()

def test_streaming_on_index_that_does_not_exist_should_throw(self):
with self.store.open_session() as session:
query = session.query(Query.from_index_name("idkb2")).where_equals("Natalia", "first_name")

with self.assertRaises(IndexDoesNotExistException):
stream = session.advanced.stream(query)
stream.__next__()

0 comments on commit fded084

Please sign in to comment.