Skip to content

test : added unit tests for Database execute/fetchone/fetchall/executescript methods - #1731

Closed
tmdeveloper007 wants to merge 1 commit into
utksh1:mainfrom
tmdeveloper007:#1726
Closed

test : added unit tests for Database execute/fetchone/fetchall/executescript methods#1731
tmdeveloper007 wants to merge 1 commit into
utksh1:mainfrom
tmdeveloper007:#1726

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Closes #1726.

Summary of What Has Been Done:
Created testing/backend/unit/test_database.py covering the basic Database class methods not tested by existing test files (test_database_connection.py and test_database_workflow_versions.py).

Changes Made:

  • New file: testing/backend/unit/test_database.py - 17 unit tests covering:
    • Database.execute: INSERT/UPDATE/DELETE rowcount, auto-commit, zero-rowcount cases
    • Database.fetchone: returns dict, returns None for missing, dict key access
    • Database.fetchall: returns list of dicts, handles zero rows, aggregates
    • Database.executescript: creates tables, auto-commits
    • Error handling: syntax errors propagate as exceptions

Impact it Made:

  • Coverage: adds tests for Database methods not covered by existing workflow/version tests
  • Reliability: ensures execute/fetch methods work correctly for all return cases
  • Completeness: fills the gap in Database class method testing

Note: This task is being handled by tmdeveloper007 — please assign to that account when picking it up.

@utksh1

utksh1 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Closing: this PR is part of the same mass template-generated low-value test batch pattern. The PRs use repetitive boilerplate bodies, copy-pasted structures, and in several cases manufacture tiny helpers or duplicate existing coverage rather than contributing one focused, meaningful improvement. Please submit a smaller, genuinely curated PR if you want to work on one concrete test gap.

@utksh1 utksh1 closed this Jul 7, 2026
@utksh1 utksh1 added gssoc:invalid Admin validation: invalid for GSSoC scoring gssoc:ai-slop Admin validation: low-quality AI-generated submission labels Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:ai-slop Admin validation: low-quality AI-generated submission gssoc:invalid Admin validation: invalid for GSSoC scoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test : add unit tests for Database helper methods

2 participants