Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cbsd: add pytest and some test cases#32

Merged
jecluis merged 1 commit into
mainfrom
wip/cbsd-pytest
Mar 18, 2026
Merged

cbsd: add pytest and some test cases#32
jecluis merged 1 commit into
mainfrom
wip/cbsd-pytest

Conversation

@jecluis
Copy link
Copy Markdown
Contributor

@jecluis jecluis commented Feb 22, 2026

Adds pytest support to the project, and introduces some tests for cbsd/.

This way we're moving away from kludge tests in modules' __main__ functions, and into something a lot more predictable and usable.

This patch set was generated mostly by Claude Opus 4.6, with guidance by the submitter.

Signed-off-by: Joao Eduardo Luis <[email protected]>

Co-authored-by: Claude Opus 4.6 <[email protected]>
Signed-off-by: Joao Eduardo Luis <[email protected]>
@jecluis jecluis requested a review from UweSchwaeke February 22, 2026 10:47
Comment thread cbsd/tests/test_auth.py
"""Valid PASETO envelope but non-JSON payload."""

def test_non_json_payload_raises(self, mock_config: Config) -> None:
assert mock_config.server is not None
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to assert the mock_config.server? mock_config.server is always not None

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't recall, but I'm pretty sure this was to make the linter happy.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to make the server not nullable? if not than feel free to resolve.

Comment thread pyrightconfig.json
Comment thread cbsd/tests/test_permissions.py
Comment thread cbsd/tests/test_permissions.py
Comment thread cbsd/tests/test_permissions.py
@jecluis jecluis merged commit 67b2cd1 into main Mar 18, 2026
@jecluis jecluis deleted the wip/cbsd-pytest branch March 18, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants