test(lexical-graph): add graph_utils boundary cases and Cypher escaping tests (#424) - #452
Open
devkamani9313-lab wants to merge 4 commits into
Open
Conversation
acarbonetto
requested changes
Aug 7, 2026
acarbonetto
left a comment
Collaborator
There was a problem hiding this comment.
These tests should be merged into existing test files:
- tests/unit/storage/graph/test_graph_utils.py — TestEscapeCypherLabel (incl. a breakout-payload case + non-string TypeError), TestFormatterForType, TestParseMetadataFiltersRecursive
- tests/unit/storage/graph/test_graph_utils_injection.py — the dedicated security/injection suite (TestValueEscaping, TestKeyEscaping) with real breakout payloads and exact-string assertions
These tests belong as added cases in the two existing files under tests/unit/storage/graph/ — the security-flavored ones
in test_graph_utils_injection.py, the plain boundary ones in test_graph_utils.py. A standalone file scatters coverage for one module across two locations and adds maintenance burden.
…existing test files (awslabs#424)
Author
|
Hi @acarbonetto! Thanks for the review. I have updated the PR as requested:\n\n- Merged plain boundary test cases into ests/unit/storage/graph/test_graph_utils.py\
|
Collaborator
|
@devkamani9313-lab please investigate failing tests: |
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.
Summary
Extends test coverage for
graph_utils.pyfunctions in thelexical-graphpackage by adding boundary and adversarial test cases as requested in #424.Additions
TestCypherLabelEscapingBoundary:escape_cypher_labelwith empty string""escape_cypher_labelwith backtick-only inputs\``` to prevent Cypher syntax injectionTestMetadataFiltersRecursiveBoundary:AND/ORcombinations)in,gt,eq)TestFormatterForTypeBoundary:formatter_for_typewith empty string inputVerification
Fixes #424
Submitted automatically via Open-Source Contribution MCP Server.