This pull request focuses on improving project documentation, updating versioning, enhancing test coverage, and adding a utility script for database maintenance.#51
Merged
Conversation
Add a utility script app/api/prospects/database/reset_flag_and_hide.py that resets the `flag` and `hide` columns to FALSE for all rows in the prospects table. It obtains a DB connection from get_db_connection(), executes the UPDATE, commits on success, rolls back on exception, and ensures cursor/connection are closed. The script can be run directly as a standalone command.
Update package version to 2.1.1 in app/__init__.py and add a new test (tests/test_prospects.py) that exercises the /prospects endpoint using FastAPI TestClient. The test asserts a 200 response, checks that the payload contains "meta" and "data" (with data as a list), verifies presence of expected keys in data items ("init" and "search"), and validates meta fields (severity and message). This adds basic endpoint coverage to prevent regressions.
Change meta payload keys in make_meta: replace "message" with "title" and "base_url" with "base". Update tests to expect the new "title" key and add a test for /prospects list. Remove the redundant tests/prospects/test_prospects.py file to consolidate test coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The most significant change is a comprehensive rewrite of the
README.mdto provide clearer setup instructions, feature descriptions, and project structure. Additionally, the PR introduces a script for resetting flags in the database, updates versioning, and refines test organization and metadata structure.Documentation Improvements:
README.mdfor better clarity, including setup instructions, feature overview, API documentation, directory structure, and contribution guidelines.Database Utilities:
reset_flag_and_hide.pyscript to reset allflagandhidefields toFALSEin theprospectstable, facilitating easier database maintenance.Versioning:
2.0.8to2.1.1inapp/__init__.py.Testing Improvements:
tests/prospects/test_prospects.pyand added a more comprehensivetests/test_prospects.pywith enhanced checks for endpoint responses and metadata. [1] [2]Metadata Consistency:
make_metautility to usetitleandbasekeys instead ofmessageandbase_urlfor improved consistency in API responses.