Skip to content

Commit e9ba4cc

Browse files
committed
RDBC-644 RavenDB_15706Test::bulkInsertWithoutDB
1 parent 9b5aac8 commit e9ba4cc

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

ravendb/documents/store/definition.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,19 +291,19 @@ def get_effective_database_static(store: DocumentStoreBase, database: str) -> st
291291
if database is None:
292292
database = store.database
293293

294-
if not database.isspace():
294+
if database and not database.isspace():
295295
return database
296296

297297
raise ValueError(
298298
"Cannot determine database to operate on. "
299299
"Please either specify 'database' directly as an action parameter "
300-
"or set the default database to operate on using 'DocumentStore.setDatabase' method. "
300+
"or set the default database to operate on using 'DocumentStore.database'. "
301301
"Did you forget to pass 'database' parameter?"
302302
)
303303

304304

305305
class DocumentStore(DocumentStoreBase):
306-
def __init__(self, urls: Optional[Union[str, List[str]]] = None, database: Optional[str] = None):
306+
def __init__(self, urls: Union[str, List[str]] = None, database: Optional[str] = None):
307307
super(DocumentStore, self).__init__()
308308
self.__subscriptions = DocumentSubscriptions(self)
309309
self.__thread_pool_executor = ThreadPoolExecutor()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from ravendb import DocumentStore
2+
from ravendb.tests.test_base import TestBase
3+
4+
5+
class TestRavenDB15706(TestBase):
6+
def setUp(self):
7+
super(TestRavenDB15706, self).setUp()
8+
9+
def test_bulk_insert_without_db(self):
10+
with DocumentStore(self.store.urls) as store:
11+
store.initialize()
12+
with self.assertRaises(ValueError):
13+
store.bulk_insert()

0 commit comments

Comments
 (0)