Skip to content

Add initial pytest unit-test suite (+ CI)#499

Open
potato-20 wants to merge 2 commits into
ReversecLabs:developfrom
potato-20:add-test-suite
Open

Add initial pytest unit-test suite (+ CI)#499
potato-20 wants to merge 2 commits into
ReversecLabs:developfrom
potato-20:add-test-suite

Conversation

@potato-20
Copy link
Copy Markdown

The repository currently ships without any automated tests. This PR introduces a tests/ package and a CI workflow to run it, without changing any production code.

What this adds

34 unit tests covering the host-side, dependency-free Python helpers:

Module Covered
reversec.common.list chunk, flatten (incl. strings-are-not-flattened)
reversec.common.text indent, wrap (newline preservation)
reversec.common.fs read / write / touch round-trips, missing-file handling
drozer.util parse_server parsing, StoreZeroOrTwo 0/2-arg validation
drozer.android.Intent validity rules, default attributes, flag combination

Tooling

  • pyproject.toml: a [tool.pytest.ini_options] section with pythonpath = ["src"] so the suite runs with a bare pytest (no editable install needed), plus a test optional-dependency.
  • .github/workflows/tests.yml: runs pytest across Python 3.9–3.13 on every push and pull request.

Notes

  • The tests deliberately exercise only modules that import cleanly without the Twisted/protobuf runtime, so CI stays fast and does not depend on a full package build.
  • No production code is modified — this is purely additive groundwork that future bug-fix PRs can extend with regression tests.
$ pytest -q
..................................                                       [100%]
34 passed in 0.05s

potato-20 added 2 commits June 2, 2026 18:58
The project shipped without any automated tests. This adds a tests/ package
with 34 unit tests covering the host-side pure-Python helpers:

  - reversec.common.list  (chunk, flatten)
  - reversec.common.text  (indent, wrap)
  - reversec.common.fs    (read/write/touch round-trips)
  - drozer.util           (parse_server, StoreZeroOrTwo)
  - drozer.android.Intent (validity, defaults, flag combination)

pyproject.toml gains a [tool.pytest.ini_options] section (pythonpath = src)
so the suite runs with a bare 'pytest' invocation, plus a 'test' optional
dependency. No production code is changed.
Adds a GitHub Actions workflow that runs the unit test suite across
Python 3.9-3.13 on every push and pull request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant