Skip to content

[FEATURE] Improve test coverage: graph_utils boundary cases and Cypher escaping #424

Description

@mykola-pereyma

Package

lexical-graph

Problem statement

graph_utils.py functions lack boundary and edge-case test coverage. test_graph_utils.py covers happy paths; test_graph_utils_injection.py covers basic injection patterns (6 tests). The remaining gaps:

  • parse_metadata_filters_recursive: NOT + empty filters, 3-level nesting, mixed children types
  • escape_cypher_label: empty string, only-backtick, newline inputs
  • formatter_for_type: empty string input
  • Adversarial escaping: unicode null bytes, homoglyphs, oversized keys (10KB+), newlines in keys, nested backtick+quote combos, values containing Cypher syntax, non-string metadata values

Related: #408, #415

Proposed solution

Extend test_graph_utils.py and test_graph_utils_injection.py with the above edge cases.

Alternatives considered

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions