Skip to content

Add test coverage for Database.execute and fetch methods#1694

Open
tmdeveloper007 wants to merge 1 commit into
utksh1:mainfrom
tmdeveloper007:#1694
Open

Add test coverage for Database.execute and fetch methods#1694
tmdeveloper007 wants to merge 1 commit into
utksh1:mainfrom
tmdeveloper007:#1694

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Problem

Database.execute, Database.fetchone, and Database.fetchall in backend/secuscan/database.py execute SQL queries and return rows. No direct unit tests cover these methods independently.

Fix

  1. Write unit tests for Database.execute, Database.execute_no_commit, Database.fetchone, and Database.fetchall using an in-memory SQLite database.
  2. Cover: successful inserts/updates, parameter binding, missing tables (error propagation), and empty result sets.

Acceptance Criteria

  • New test file with 10+ tests covering all four methods.
  • All tests pass locally.

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.

1 participant