Skip to content

Commit 80ff248

Browse files
authored
ci: add test test_delete_system_connectors (#8)
1 parent 29c2274 commit 80ff248

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

src/examples/notebooks/vectorize.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"import vectorize_client as v\n",
9090
"\n",
9191
"\n",
92-
"api = v.ApiClient(v.Configuration(access_token=token, host=\"http://api.vectorize.io/v1\"))\n",
92+
"api = v.ApiClient(v.Configuration(access_token=token, host=\"https://api.vectorize.io/v1\"))\n",
9393
"pipelines = v.PipelinesApi(api)\n",
9494
"\n",
9595
"response = pipelines.get_pipelines(org)\n",
@@ -266,7 +266,6 @@
266266
" \"chunkSize\": 600,\n",
267267
" \"chunkingStrategy\": \"FIXED\",\n",
268268
" \"embeddingModel\": \"VECTORIZE_OPEN_AI_TEXT_EMBEDDING_3_LARGE\",\n",
269-
" #\"extractionStrategy\": \"MIXED\"\n",
270269
" }),\n",
271270
" pipeline_name=\"My Pipeline From API\",\n",
272271
" schedule=v.ScheduleSchema(type=\"manual\")\n",
Binary file not shown.

tests/python/tests/test_client.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,38 @@ def test_get_pipelines(ctx: TestContext):
4646
logging.info(pipeline.id)
4747

4848

49+
50+
def test_delete_system_connectors(ctx: TestContext):
51+
connectors = v.ConnectorsApi(ctx.api_client)
52+
53+
ai_platforms = connectors.get_ai_platform_connectors(ctx.org_id)
54+
builtin_ai_platform = [c.id for c in ai_platforms.ai_platform_connectors if c.type == "VECTORIZE"][0]
55+
56+
destination_connectors = connectors.get_destination_connectors(ctx.org_id)
57+
builtin_vector_db = [c.id for c in destination_connectors.destination_connectors if c.type == "VECTORIZE"][0]
58+
59+
60+
try:
61+
connectors.delete_ai_platform(ctx.org_id, builtin_ai_platform)
62+
raise ValueError("test should have failed")
63+
except Exception as e:
64+
logging.error(f"Failed to delete: {e}")
65+
if "Cannot delete system connector" in str(e):
66+
pass
67+
else:
68+
raise e
69+
70+
try:
71+
connectors.delete_destination_connector(ctx.org_id, builtin_vector_db)
72+
raise ValueError("test should have failed")
73+
except Exception as e:
74+
logging.error(f"Failed to delete: {e}")
75+
if "Cannot delete system connector" in str(e):
76+
pass
77+
else:
78+
raise e
79+
80+
4981
def test_upload_create_pipeline(ctx: TestContext):
5082
pipelines = v.PipelinesApi(ctx.api_client)
5183

0 commit comments

Comments
 (0)