Skip to content

Commit e025884

Browse files
committed
Sync up test_runs with main. Version bump
1 parent ee33977 commit e025884

2 files changed

Lines changed: 7 additions & 34 deletions

File tree

python/lib/sift_client/_tests/resources/test_runs.py

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from datetime import datetime, timedelta, timezone
1111

1212
import pytest
13+
from grpc.aio import AioRpcError
1314

1415
from sift_client import SiftClient
1516
from sift_client.resources import RunsAPI, RunsAPIAsync
@@ -182,7 +183,11 @@ class TestFind:
182183
async def test_find_run(self, runs_api_async, test_run):
183184
"""Test finding a single run."""
184185
# Find the same run by name
185-
found_run = await runs_api_async.find(name=test_run.name)
186+
found_run = await runs_api_async.find(
187+
name=test_run.name,
188+
created_after=test_run.created_date - timedelta(seconds=10),
189+
created_before=test_run.created_date + timedelta(seconds=10),
190+
)
186191

187192
assert found_run is not None
188193
assert found_run.id_ == test_run.id_
@@ -546,38 +551,6 @@ async def test_create_adhoc_run_missing_assets(self, runs_api_async):
546551
run_create, assets=["asset-name-not-id"], associate_new_data=False
547552
)
548553

549-
@pytest.mark.asyncio
550-
async def test_create_automatic_association_for_assets(self, runs_api_async, sift_client):
551-
"""Test associating assets with a run for automatic data ingestion."""
552-
# Create a test run
553-
run_name = f"test_run_asset_assoc_{datetime.now(timezone.utc).isoformat()}"
554-
run_create = RunCreate(
555-
name=run_name,
556-
description="Test run for asset association",
557-
tags=["sift-client-pytest"],
558-
)
559-
created_run = await runs_api_async.create(run_create)
560-
561-
try:
562-
# Get some assets to associate
563-
assets = await sift_client.async_.assets.list_(limit=2)
564-
assert len(assets) >= 1
565-
566-
asset_names = [asset.name for asset in assets[:2]]
567-
568-
# Associate assets with the run
569-
await runs_api_async.create_automatic_association_for_assets(
570-
run=created_run, asset_names=asset_names
571-
)
572-
573-
# Verify the association by getting the run and checking asset_ids
574-
updated_run = await runs_api_async.get(run_id=created_run.id_)
575-
assert updated_run.asset_ids is not None
576-
assert len(updated_run.asset_ids) >= len(asset_names)
577-
578-
finally:
579-
await runs_api_async.archive(created_run)
580-
581554

582555
class TestRunsAPISync:
583556
"""Test suite for the synchronous Runs API functionality.

python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "sift_stack_py"
3-
version = "1.0.0a1"
3+
version = "1.0.0a2"
44
description = "Python client library for the Sift API"
55
requires-python = ">=3.8"
66
readme = { file = "README.md", content-type = "text/markdown" }

0 commit comments

Comments
 (0)