Skip to content

Commit

Permalink
Add a dummy test case
Browse files Browse the repository at this point in the history
  • Loading branch information
walles committed Jun 12, 2024
1 parent 5074858 commit dd31284
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
Empty file added tests/__init__.py
Empty file.
21 changes: 21 additions & 0 deletions tests/test_find_bad_tracks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from typing import cast, List

from bpy.types import MovieClip, MovieTracking, MovieTrackingTrack, MovieTrackingTracks

from find_bad_motion_tracks.find_bad_tracks import find_bad_tracks


def make_clip() -> MovieClip:
tracks: List[MovieTrackingTrack] = []

clip = MovieClip()
clip.frame_start = 0
clip.frame_duration = 10
clip.tracking = MovieTracking()
clip.tracking.tracks = cast(MovieTrackingTracks, tracks)
return clip


def test_find_bad_tracks_no_tracks():
test_clip = make_clip()
find_bad_tracks(test_clip)
11 changes: 10 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[tox]
# NOTE: Should match one of the [gh-actions] configs below
envlist = ruff-format, mypy, ruff-check
envlist = ruff-format, mypy, ruff-check, test

ruff_version = 0.4.4
pytest_version = 8.2.2

src_dir = find_bad_motion_tracks

Expand Down Expand Up @@ -45,3 +46,11 @@ deps =
# Auto-fix locally but not in CI
commands =
/bin/bash -c 'FIX="--fix" ; if [ "{env:CI:}" ] ; then FIX="--no-fix" ; fi ; ruff check $FIX {[tox]src_dir}'

[testenv:test]
depends = ruff-format
deps =
pytest == {[tox]pytest_version}
-r requirements.txt
commands =
pytest --durations=10 --color=yes tests

0 comments on commit dd31284

Please sign in to comment.