4
4
from testcontainers .core .waiting_utils import wait_container_is_ready
5
5
6
6
from ._emulator import CosmosDBEmulatorContainer
7
- __all__ = ["NoSQLEmulatorContainer " ]
7
+ __all__ = ["CosmosDBNoSQLEndpointContainer " ]
8
8
9
9
NOSQL_PORT = 8081
10
10
11
- class NoSQLEmulatorContainer (CosmosDBEmulatorContainer ):
11
+ class CosmosDBNoSQLEndpointContainer (CosmosDBEmulatorContainer ):
12
12
"""
13
13
CosmosDB NoSQL enpoint Emulator.
14
14
15
15
Example:
16
+
16
17
.. doctest::
17
- >>> from testcontainers.cosmosdb import NoSQLEmulatorContainer
18
- >>> with NoSQLEmulatorContainer() as emulator:
19
- ... db = emulator.insecure_sync_client().create_database_if_not_exists("test")
18
+
19
+ >>> from testcontainers.cosmosdb import CosmosDBNoSQLEndpointContainer
20
+ >>> with CosmosDBNoSQLEndpointContainer() as emulator:
21
+ ... db = emulator.insecure_sync_client().create_database_if_not_exists("test")
20
22
21
23
.. doctest::
22
- >>> from testcontainers.cosmosdb import NoSQLEmulatorContainer
23
- >>> with NoSQLEmulatorContainer() as emulator:
24
- ... client = CosmosClient(url=emulator.url, credential=emulator.key, connection_verify=False)
25
- ... db = client.create_database_if_not_exists("test")
24
+
25
+ >>> from testcontainers.cosmosdb import CosmosDBNoSQLEndpointContainer
26
+ >>> from azure.cosmos import CosmosClient
27
+
28
+ >>> with CosmosDBNoSQLEndpointContainer() as emulator:
29
+ ... client = CosmosClient(url=emulator.url, credential=emulator.key, connection_verify=False)
30
+ ... db = client.create_database_if_not_exists("test")
26
31
27
32
"""
28
33
@@ -43,13 +48,13 @@ def url(self) -> str:
43
48
"""
44
49
return f"https://{ self .host } :{ self .port } "
45
50
46
- def insecure_async_client (self ) -> AsyncCosmosClient :
51
+ def insecure_async_client (self ):
47
52
"""
48
53
Returns an asynchronous CosmosClient instance
49
54
"""
50
55
return AsyncCosmosClient (url = self .url , credential = self .key , connection_verify = False )
51
56
52
- def insecure_sync_client (self ) -> SyncCosmosClient :
57
+ def insecure_sync_client (self ):
53
58
"""
54
59
Returns a synchronous CosmosClient instance
55
60
"""
0 commit comments