Add a real test command, CI, and cover the pure helpers

Open
#18 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
78/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions, python
Domain
ci-cd, testing

Research direction

Read easyedit/util.py for slugify(), easyedit/web.py for safe_job() and picture_bytes(), and easyedit/quote.py for lines(), _tighten() and _clean(). First choose pytest or unittest discover, then update the README command and add a .github/workflows/*.yml job that installs dependencies and runs the suite. Done when the listed pure helper cases run without FFmpeg, network or model dependencies and CI passes.

Written by the indexing model from the issue text.

Description

help wanted tests

The project has exactly one test (tests/test_design.py), it needs OpenCV to run, there is no CI workflow, and the documented command (python -m pytest) doesn't work on a fresh clone.

Task: pick and document one runner — add pytest to a dev requirements file, or standardise on python -m unittest discover — add a GitHub Actions job that installs the deps and runs it, and seed the suite with the pure functions that need no FFmpeg, network or model:

  • util.slugify and web.safe_job together. The slug round-trip is what keeps /media/, /thumb/ and /api/delete inside jobs/, so traversal, absolute paths, over-length and empty slugs all deserve cases. safe_job is the security-relevant pure function with zero coverage today.
  • quote.lines plus quote._tighten and quote._clean — line breaking at the 6-word / 26-char / 0.45s-pause boundaries, the single-trailing-word merge, and dropping a dead-air run longer than MAX_GAP.
  • web.picture_bytes — raw bytes passthrough, a well-formed multipart part, a missing boundary, and a part named something other than picture.

Where: new .github/workflows/*.yml; easyedit/util.py → slugify(); easyedit/web.py → safe_job() (lines 52-61) and picture_bytes() (lines 32-49); easyedit/quote.py → lines() (lines 146-164), _tighten(), _clean(); README.md:249.


Getting started: Python 3.10+, Node 22+, FFmpeg on PATH. npm install, pip install -r requirements.txt, then python -m easyedit.doctor. Run python -m unittest discover before opening a PR. Passing --llm none skips the model entirely, which is the fastest way to test. Comment here to claim it. Questions → Discord.

Dominant language
Python
Stars
168
Forks
24
Avg merge
2d 10h
Merged PRs (30d)
14

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from blixvip/easyedit

All issues in blixvip/easyedit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.