Skip to content

Commit c666af7

Browse files
committed
more tests
1 parent 1076a90 commit c666af7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/serve/plugin.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import time
44
from concurrent import futures
55
from cloudquery.sdk import serve
6+
from cloudquery.sdk import message
67
from cloudquery.plugin_v3 import plugin_pb2_grpc, plugin_pb2, arrow
78
from cloudquery.sdk.internal.memdb import MemDB
89

@@ -29,6 +30,14 @@ def test_plugin_serve():
2930
response = stub.GetTables(plugin_pb2.GetTables.Request())
3031
schemas = arrow.new_schemas_from_bytes(response.tables)
3132
assert len(schemas) == 1
33+
34+
response = stub.Sync(plugin_pb2.Sync.Request())
35+
total_records = 0
36+
for msg in response:
37+
if msg.insert is not None:
38+
rec = arrow.new_record_from_bytes(msg.insert.record)
39+
total_records += 1
40+
assert total_records == 1
3241
finally:
3342
cmd.stop()
3443
pool.shutdown()

0 commit comments

Comments
 (0)