Skip to content

test(users): mocked error-path coverage for create_user#203

Merged
deveaud-m merged 1 commit into
fossology:mainfrom
Valyrian-Code:test/users-create-error
Jul 10, 2026
Merged

test(users): mocked error-path coverage for create_user#203
deveaud-m merged 1 commit into
fossology:mainfrom
Valyrian-Code:test/users-create-error

Conversation

@Valyrian-Code

Copy link
Copy Markdown
Contributor

Refs #200.

Continuing the test-suite alignment. create_user was only exercised through a live fixture, so its non-201 branches had no direct test. Adds mocked tests for both:

  • test_create_user_error (500 -> FossologyApiError)
  • test_create_user_already_exists (409 -> logged, no error)

Verified against a live Fossology 4.4.0 container; ruff and mypy pass.

Refs fossology#200.

create_user was only exercised via a live fixture. Adds mocked tests for its
non-201 branches: a 409 "already exists" (logged, no error) and a 500 server
error (FossologyApiError), matching the error-path mocking used elsewhere.

Signed-off-by: RAJVEER42 <irajveer.bishnoi2310@gmail.com>
Copilot AI review requested due to automatic review settings July 8, 2026 08:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@deveaud-m deveaud-m merged commit a843f79 into fossology:main Jul 10, 2026
3 checks passed
@Valyrian-Code Valyrian-Code deleted the test/users-create-error branch July 10, 2026 16:03
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.

3 participants