Added unit tests - #3
Open
AkshatSharma25 wants to merge 1 commit into
Open
Conversation
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.
Closes #2
The description of the test cases added is as follows:
File 1:
test_utils.pyBefore data goes anywhere near an AI, it needs a cleanup. These 13 tests make sure our functions aren’t slacking.
Text Cleaning
We don’t want wasted tokens or messy formatting confusing the model.
Hello WorldintoHello World.\twith normal spaces so searches behave.Filename Regex
Makes sure we correctly split CSV rows into
filenameandcontent.document.txt,Contentcleanly.Hash Functions
Prevents us from paying to process the same text twice.
File 2:
test_basic.pyThese 9 tests make sure our data structures and settings won’t fall apart when we hit “Go.”
Data Structures
textandfile. No exceptions.sourceandindex.Config Guards
chunk_overlapmust be smaller thanchunk_size.temperaturestays between 0–2, andmax_tokenscan’t be negative.Prompt Templates
{context}and{question}still exist.Clean data. Solid structure. Safe configs. No surprises.