Skip to content

test(cmd): add prompt command tests#986

Merged
Lokesh7025 merged 10 commits into
BlazeUp-AI:mainfrom
Nithin0620:fix/test-cmd-prompt
May 25, 2026
Merged

test(cmd): add prompt command tests#986
Lokesh7025 merged 10 commits into
BlazeUp-AI:mainfrom
Nithin0620:fix/test-cmd-prompt

Conversation

@Nithin0620

Copy link
Copy Markdown
Contributor

Purpose / Description

Adds test coverage for the prompt command validation flow.

The tests verify handling of valid and malformed payloads and improve
coverage around request validation behavior.

Fixes

Approach

Added new test cases for the prompt command to validate request handling
and ensure malformed inputs are handled correctly.

How Has This Been Tested?

Tested locally using:

make test

Also ran targeted tests with:

cd observal-server
uv run pytest ../tests/test_cmd_prompt.py -v

Learning (optional, can help others)

Learned more about the repository testing workflow using uv, pytest,
and the project Makefile setup.

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (not applicable)

@CLAassistant

CLAassistant commented May 14, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codecov

codecov Bot commented May 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Lokesh7025

Copy link
Copy Markdown
Contributor
   High priority:
   1. Add error/edge-case tests: mutually exclusive flags, empty results, file-not-found, API errors 
   
   Suggestions : 
   
   2. Move mock assertions inside the with block for clarity
   3. Add a test that validates select_one rejects invalid categories (or explicitly note this is an integration gap)

@Nithin0620

Copy link
Copy Markdown
Contributor Author
   High priority:
   1. Add error/edge-case tests: mutually exclusive flags, empty results, file-not-found, API errors 
   
   Suggestions : 
   
   2. Move mock assertions inside the with block for clarity
   3. Add a test that validates select_one rejects invalid categories (or explicitly note this is an integration gap)

Thanks! Added the requested edge-case tests, moved mock assertions inside the with blocks, and documented the invalid category handling/integration gap with a test.

@ShaanNarendran

Copy link
Copy Markdown
Contributor

lint is failing, one more review after and we can merge

@github-actions github-actions Bot added the tests Pull request adds or modifies tests label May 24, 2026
@Nithin0620

Copy link
Copy Markdown
Contributor Author

lint is failing, one more review after and we can merge

Done, Resolved the lint errors.

@Lokesh7025 Lokesh7025 merged commit ac8f458 into BlazeUp-AI:main May 25, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Pull request adds or modifies tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for observal_cli/cmd_prompt.py

4 participants