Skip to content

Commit 9578c40

Browse files
committed
sync
1 parent 117ad24 commit 9578c40

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

tests/conftest.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pytest
55
import ydb
66
import time
7+
import subprocess
78

89

910
@pytest.fixture(autouse=True, scope="session")
@@ -56,9 +57,9 @@ def secure_endpoint(pytestconfig, session_scoped_container_getter):
5657
assert os.path.exists(ca_path)
5758
os.environ["YDB_SSL_ROOT_CERTIFICATES_FILE"] = ca_path
5859
with ydb.Driver(
59-
endpoint="grpcs://localhost:2135",
60-
database="/local",
61-
root_certificates=ydb.load_ydb_root_certificate(),
60+
endpoint="grpcs://localhost:2135",
61+
database="/local",
62+
root_certificates=ydb.load_ydb_root_certificate(),
6263
) as driver:
6364
wait_container_ready(driver)
6465
yield "localhost:2135"
@@ -96,3 +97,18 @@ async def driver(endpoint, database, event_loop):
9697
yield driver
9798

9899
await driver.stop(timeout=10)
100+
101+
102+
@pytest.fixture()
103+
def topic_path() -> str:
104+
subprocess.run(
105+
"""docker-compose exec ydb /ydb -e grpc://localhost:2136 -d /local topic drop /local/test-topic""",
106+
shell=True,
107+
)
108+
res = subprocess.run(
109+
"""exec ydb /ydb -e grpc://localhost:2136 -d /local topic create /local/test-topic""",
110+
shell=True,
111+
)
112+
assert res.returncode == 0
113+
114+
return "/local/test-topic"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
3+
def test_write_single_message(driver, topic_path):
4+
print(topic_path)

0 commit comments

Comments
 (0)