Skip to content

Conversation

Copy link

Copilot AI commented Dec 23, 2025

The test_missing_uniqueid test was dependent on actual environment configuration (PGVECTOR_* vars), making it potentially flaky.

Changes

  • Added @patch("api.db.is_configured", return_value=False) to test_missing_uniqueid
  • Ensures test behavior is deterministic regardless of environment state
  • Added .gitignore to prevent committing Python cache files and coverage reports
@patch("api.db.is_configured", return_value=False)
def test_missing_uniqueid(self, mock_db_configured, client, valid_wav_content):
    """Test that missing uniqueid is rejected when persistence is requested."""
    response = client.post(
        "/api/get_transcription",
        files={"file": ("test.wav", valid_wav_content, "audio/wav")},
        data={"persist": "true"},
    )
    
    assert response.status_code == 400
    assert "uniqueid" in response.json()["detail"]

The mock returns False to focus on uniqueid validation logic, which executes before the database configuration check in the API flow.


💡 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 in the docs.

Copilot AI and others added 2 commits December 23, 2025 09:57
…nment

Co-authored-by: Stell0 <4547897+Stell0@users.noreply.github.com>
Co-authored-by: Stell0 <4547897+Stell0@users.noreply.github.com>
Copilot AI changed the title [WIP] Update diarized transcription API implementation based on feedback Mock db.is_configured in test_missing_uniqueid to isolate from environment Dec 23, 2025
Copilot AI requested a review from Stell0 December 23, 2025 10:00
@Stell0 Stell0 marked this pull request as ready for review December 23, 2025 11:00
@Stell0 Stell0 merged commit 470caad into statictrans Dec 23, 2025
5 checks passed
@Stell0 Stell0 deleted the copilot/sub-pr-4 branch December 23, 2025 11:00
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