File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from typing import cast
2+ from urllib .parse import urljoin
23
34from opentelemetry .trace import get_tracer
45
56from cbltest .api .database import Database
7+ from cbltest .assertions import _assert_not_null
68from cbltest .globals import CBLPyTestGlobal
79from cbltest .requests import RequestFactory , TestServerRequestType
810from cbltest .responses import GetRootResponse
@@ -117,3 +119,13 @@ async def log(self, msg: str) -> None:
117119 TestServerRequestType .LOG , payload
118120 )
119121 await self .__request_factory .send_request (self .__index , request )
122+
123+ def replication_url (self , db_name : str , port : int ):
124+ """
125+ Returns the URL of the replication endpoint for this test server
126+ """
127+ ws_scheme = "ws://" # For now not using secure
128+
129+ _assert_not_null (db_name , "db_name" )
130+ replication_url = f"{ ws_scheme } { self .url } :{ port } "
131+ return urljoin (replication_url , db_name )
You can’t perform that action at this time.
0 commit comments