Skip to content

Add automated test suite for Python tools (parse_contract.py, add_review_comments.py, compare_versions.py) #1

@cschanhniem

Description

@cschanhniem

Problem

The toolkit relies on three Python tools — , , and — that perform file I/O and text processing on legal documents. These tools have no automated test suite. In a legal context where accuracy is critical, untested code risks silently corrupting contracts, misplacing comments, or misreporting diffs.

Evidence

From the project structure:

There is no tests/ directory, no pytest configuration, and no test runner in requirements.txt.

Suggested approach

  1. Create tests/test_parse_contract.py — test with a known .docx fixture; verify text extraction matches expected output
  2. Create tests/test_add_review_comments.py — test that inline comments are injected at the correct paragraphs
  3. Create tests/test_compare_versions.py — test with two known contract versions; verify detected changes match expected diffs
  4. Add pytest and python-docx to requirements.txt (if not already present)
  5. Add a pytest step to README.md Quick Start

I'm happy to contribute a test fixture set with sample .docx files if that helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions