Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
}
]
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 10 additions & 10 deletions tests/test_account_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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)

Expand Down Expand Up @@ -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/"),
Expand Down Expand Up @@ -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):
Expand All @@ -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(""),
Expand All @@ -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(""),
Expand All @@ -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
):
Expand All @@ -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
):
Expand Down
Loading