From 3a036a88ac9f1f72813382fcaf9ea90ca6de1a25 Mon Sep 17 00:00:00 2001 From: quettabit <27509167+quettabit@users.noreply.github.com> Date: Mon, 13 Apr 2026 18:23:33 -0600 Subject: [PATCH] initial commit --- .github/workflows/ci.yml | 2 +- pytest.ini | 2 +- tests/test_account_ops.py | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef33789..6f3793f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,6 +72,6 @@ jobs: "ref": "${{ github.ref }}", "lang": "python", "uv-version": "0.11.3", - "test_cmd": "uv run pytest tests/ -v -s -m '(account or basin or stream) and not cloud_only'" + "test_cmd": "uv run pytest tests/ -v -s -m '(account or basin or stream) and not access_tokens'" } ] diff --git a/pytest.ini b/pytest.ini index b998b45..7fa0aad 100644 --- a/pytest.ini +++ b/pytest.ini @@ -17,4 +17,4 @@ markers = basin: tests for basin operations stream: tests for stream operations metrics: tests for metrics operations - cloud_only: tests that require s2-cloud (not supported on s2-lite) + access_tokens: tests for access token operations diff --git a/tests/test_account_ops.py b/tests/test_account_ops.py index af3d6f8..6ae14bc 100644 --- a/tests/test_account_ops.py +++ b/tests/test_account_ops.py @@ -134,7 +134,7 @@ async def test_list_basins_with_prefix(self, s2: S2, basin_name: str): finally: await s2.delete_basin(basin_name) - @pytest.mark.cloud_only + @pytest.mark.access_tokens async def test_issue_access_token(self, s2: S2, token_id: str, basin_prefix: str): scope = AccessTokenScope( basins=PrefixMatch(basin_prefix), @@ -153,7 +153,7 @@ async def test_issue_access_token(self, s2: S2, token_id: str, basin_prefix: str finally: await s2.revoke_access_token(token_id) - @pytest.mark.cloud_only + @pytest.mark.access_tokens async def test_issue_access_token_with_expiry(self, s2: S2, token_id: str): expires_at = datetime.now(timezone.utc) + timedelta(hours=1) @@ -182,7 +182,7 @@ async def test_issue_access_token_with_expiry(self, s2: S2, token_id: str): finally: await s2.revoke_access_token(token_id) - @pytest.mark.cloud_only + @pytest.mark.access_tokens async def test_issue_access_token_with_auto_prefix(self, s2: S2, token_id: str): scope = AccessTokenScope( streams=PrefixMatch("prefix/"), @@ -210,11 +210,11 @@ async def test_issue_access_token_with_auto_prefix(self, s2: S2, token_id: str): finally: await s2.revoke_access_token(token_id) - @pytest.mark.cloud_only async def test_get_basin_config(self, s2: S2, basin: S2Basin): config = await s2.get_basin_config(basin.name) - assert config is not None - assert config.default_stream_config is not None + assert isinstance(config, BasinConfig) + assert config.create_stream_on_append is False + assert config.create_stream_on_read is False async def test_delete_nonexistent_basin_errors(self, s2: S2): with pytest.raises(S2ServerError): @@ -241,7 +241,7 @@ async def test_list_basins_with_prefix_and_start_after( for basin_info in basin_infos: await s2.delete_basin(basin_info.name) - @pytest.mark.cloud_only + @pytest.mark.access_tokens async def test_list_access_tokens_with_limit(self, s2: S2, token_id: str): scope = AccessTokenScope( streams=PrefixMatch(""), @@ -255,7 +255,7 @@ async def test_list_access_tokens_with_limit(self, s2: S2, token_id: str): finally: await s2.revoke_access_token(token_id) - @pytest.mark.cloud_only + @pytest.mark.access_tokens async def test_list_access_tokens_with_prefix(self, s2: S2, token_id: str): scope = AccessTokenScope( streams=PrefixMatch(""), @@ -270,7 +270,7 @@ async def test_list_access_tokens_with_prefix(self, s2: S2, token_id: str): finally: await s2.revoke_access_token(token_id) - @pytest.mark.cloud_only + @pytest.mark.access_tokens async def test_issue_access_token_with_no_permitted_ops_errors( self, s2: S2, token_id: str ): @@ -279,7 +279,7 @@ async def test_issue_access_token_with_no_permitted_ops_errors( with pytest.raises(S2ServerError): await s2.issue_access_token(id=token_id, scope=scope) - @pytest.mark.cloud_only + @pytest.mark.access_tokens async def test_issue_access_token_with_auto_prefix_without_prefix_errors( self, s2: S2, token_id: str ):