Skip to content

Add comprehensive unit tests for workflows and APIs#70

Merged
MarkusNeusinger merged 4 commits intomainfrom
claude/add-workflow-api-tests-01F3xWa4yNDwsSYAN5rv6W7x
Nov 30, 2025
Merged

Add comprehensive unit tests for workflows and APIs#70
MarkusNeusinger merged 4 commits intomainfrom
claude/add-workflow-api-tests-01F3xWa4yNDwsSYAN5rv6W7x

Conversation

@MarkusNeusinger
Copy link
Copy Markdown
Owner

  • Fix always-true assertions in test_workflows.py
  • Fix regex logic for empty section detection in test_prompts.py
  • Fix CORS test to properly check headers and reject error status codes
  • Improve workflow name matching to use substring comparison
  • Update requires-python from >=3.14 to >=3.13

- Fix always-true assertions in test_workflows.py
- Fix regex logic for empty section detection in test_prompts.py
- Fix CORS test to properly check headers and reject error status codes
- Improve workflow name matching to use substring comparison
- Update requires-python from >=3.14 to >=3.13
Copilot AI review requested due to automatic review settings November 30, 2025 20:16
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes several always-true test assertions and improves test logic quality across workflow, prompt, and API tests. It also updates the Python version requirement from 3.14 to 3.13 and includes corresponding dependency updates in uv.lock.

Key Changes:

  • Fixed workflow name matching to use meaningful substring comparison instead of always-true assertions
  • Corrected empty section detection regex in prompt tests to properly validate section content
  • Improved CORS tests to actually verify headers and reject error status codes
  • Downgraded Python version requirement to 3.13 (from unreleased 3.14)

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unit/workflows/test_workflows.py Fixed always-true assertion (len(overlap) >= 0) and added substring matching; removed useless assert True pattern
tests/unit/prompts/test_prompts.py Rewrote empty section detection to properly parse headers and check content instead of flawed regex
tests/unit/api/test_main.py Enhanced CORS tests to validate specific headers and reject error status codes (400)
pyproject.toml Changed requires-python from >=3.14 to >=3.13
uv.lock Added Python 3.13 wheel dependencies for various packages

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread tests/unit/workflows/test_workflows.py Outdated
Comment thread tests/unit/workflows/test_workflows.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 30, 2025 20:23
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.


You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@MarkusNeusinger
Copy link
Copy Markdown
Owner Author

@copilot fix linting

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 30, 2025

@MarkusNeusinger I've opened a new pull request, #71, to work on those changes. Once the pull request is ready, I'll request review from you.

Several test assertions were always-true, providing no actual
validation. Fixed these to perform meaningful checks.

### Changes

- **test_workflows.py**: Fixed workflow name matching to use substring
comparison instead of `len(file_words) == 1` fallback that always passed
for single-word filenames
- **test_workflows.py**: Removed unused `has_fetch_depth` variable (lint
fix)
- **test_prompts.py**: Fixed empty section detection regex to properly
validate section content
- **test_main.py**: Fixed CORS test to verify headers exist and reject
error status codes
- **pyproject.toml**: Downgraded `requires-python` from `>=3.14` to
`>=3.13` (3.14 unreleased)

### Example fix

```python
# Before: always passes for single-word filenames
has_relation = len(overlap) > 0 or has_substring_match or len(file_words) == 1

# After: meaningful validation
has_relation = len(overlap) > 0 or has_substring_match
```

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MarkusNeusinger <2921697+MarkusNeusinger@users.noreply.github.com>
@MarkusNeusinger MarkusNeusinger merged commit 48ec2c9 into main Nov 30, 2025
3 checks passed
@MarkusNeusinger MarkusNeusinger deleted the claude/add-workflow-api-tests-01F3xWa4yNDwsSYAN5rv6W7x branch November 30, 2025 20:49
MarkusNeusinger added a commit that referenced this pull request Dec 1, 2025
- Fix always-true assertions in test_workflows.py
- Fix regex logic for empty section detection in test_prompts.py
- Fix CORS test to properly check headers and reject error status codes
- Improve workflow name matching to use substring comparison
- Update requires-python from >=3.14 to >=3.13
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.

4 participants