Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattBlue committed Nov 28, 2023
1 parent dc9828c commit 6b7747a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_colorspace.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from av.video.reformatter import ColorRange, Colorspace
import av

from .common import TestCase, fate_suite


class TestColorSpace(TestCase):
def test_color_range(self):
container = av.open(
fate_suite("amv/MTV_high_res_320x240_sample_Penguin_Joke_MTV_from_WMV.amv")
)
stream = container.streams.video[0]

self.assertEqual(stream.color_range, None)

for packet in container.demux(stream):
for frame in packet.decode():
self.assertEqual(frame.color_range, ColorRange.JPEG)
self.assertEqual(frame.colorspace, Colorspace.ITU601)
return

0 comments on commit 6b7747a

Please sign in to comment.