File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
modules/cosmosdb/testcontainers/cosmosdb Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -71,22 +71,11 @@ def __init__(
71
71
** docker_client_kw ,
72
72
):
73
73
super ().__init__ (image = image , ** docker_client_kw )
74
-
75
74
self .partition_count = partition_count
76
75
self .key = key
77
76
self .enable_data_persistence = enable_data_persistence
78
77
self .endpoints = frozenset (endpoints )
79
-
80
- self .with_bind_ports (EMULATOR_PORT , EMULATOR_PORT )
81
-
82
- endpoints_ports = []
83
- for endpoint in self .endpoints :
84
- endpoints_ports .extend (endpoint_ports [endpoint ])
85
-
86
- if bind_ports :
87
- [ self .with_bind_ports (port , port ) for port in endpoints_ports ]
88
- else :
89
- self .with_exposed_ports (* endpoints_ports )
78
+ self .bind_ports = bind_ports
90
79
91
80
def start (self ) -> Self :
92
81
self ._configure ()
@@ -122,6 +111,17 @@ def sync_client(self) -> SyncCosmosClient:
122
111
return SyncCosmosClient (url = self .url , credential = self .key , connection_verify = False )
123
112
124
113
def _configure (self ) -> None :
114
+ self .with_bind_ports (EMULATOR_PORT , EMULATOR_PORT )
115
+
116
+ endpoints_ports = []
117
+ for endpoint in self .endpoints :
118
+ endpoints_ports .extend (endpoint_ports [endpoint ])
119
+
120
+ if self .bind_ports :
121
+ [ self .with_bind_ports (port , port ) for port in endpoints_ports ]
122
+ else :
123
+ self .with_exposed_ports (* endpoints_ports )
124
+
125
125
(
126
126
self
127
127
.with_env ("AZURE_COSMOS_EMULATOR_PARTITION_COUNT" , str (self .partition_count ))
You can’t perform that action at this time.
0 commit comments