Skip to content

ci: add test test_delete_system_connectors #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/examples/notebooks/vectorize.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"import vectorize_client as v\n",
"\n",
"\n",
"api = v.ApiClient(v.Configuration(access_token=token, host=\"http://api.vectorize.io/v1\"))\n",
"api = v.ApiClient(v.Configuration(access_token=token, host=\"https://api.vectorize.io/v1\"))\n",
"pipelines = v.PipelinesApi(api)\n",
"\n",
"response = pipelines.get_pipelines(org)\n",
Expand Down Expand Up @@ -266,7 +266,6 @@
" \"chunkSize\": 600,\n",
" \"chunkingStrategy\": \"FIXED\",\n",
" \"embeddingModel\": \"VECTORIZE_OPEN_AI_TEXT_EMBEDDING_3_LARGE\",\n",
" #\"extractionStrategy\": \"MIXED\"\n",
" }),\n",
" pipeline_name=\"My Pipeline From API\",\n",
" schedule=v.ScheduleSchema(type=\"manual\")\n",
Expand Down
Binary file not shown.
32 changes: 32 additions & 0 deletions tests/python/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,38 @@ def test_get_pipelines(ctx: TestContext):
logging.info(pipeline.id)



def test_delete_system_connectors(ctx: TestContext):
connectors = v.ConnectorsApi(ctx.api_client)

ai_platforms = connectors.get_ai_platform_connectors(ctx.org_id)
builtin_ai_platform = [c.id for c in ai_platforms.ai_platform_connectors if c.type == "VECTORIZE"][0]

destination_connectors = connectors.get_destination_connectors(ctx.org_id)
builtin_vector_db = [c.id for c in destination_connectors.destination_connectors if c.type == "VECTORIZE"][0]


try:
connectors.delete_ai_platform(ctx.org_id, builtin_ai_platform)
raise ValueError("test should have failed")
except Exception as e:
logging.error(f"Failed to delete: {e}")
if "Cannot delete system connector" in str(e):
pass
else:
raise e

try:
connectors.delete_destination_connector(ctx.org_id, builtin_vector_db)
raise ValueError("test should have failed")
except Exception as e:
logging.error(f"Failed to delete: {e}")
if "Cannot delete system connector" in str(e):
pass
else:
raise e


def test_upload_create_pipeline(ctx: TestContext):
pipelines = v.PipelinesApi(ctx.api_client)

Expand Down
Loading