Skip to content

Commit 540d423

Browse files
author
Daniel Flores
committed
test bad format
1 parent e2dac79 commit 540d423

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/test_ops.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,6 +1380,16 @@ def test_bad_input(self, tmp_path):
13801380
filename="./bad/path.mp3",
13811381
)
13821382

1383+
with pytest.raises(
1384+
RuntimeError,
1385+
match=r"Couldn't allocate AVFormatContext. Check the desired format\? Got format=bad_format",
1386+
):
1387+
encode_video_to_tensor(
1388+
frames=torch.randint(high=255, size=(10, 3, 60, 60), dtype=torch.uint8),
1389+
frame_rate=10,
1390+
format="bad_format",
1391+
)
1392+
13831393
def decode(self, source=None) -> torch.Tensor:
13841394
return VideoDecoder(source).get_frames_in_range(start=0, stop=60)
13851395

0 commit comments

Comments
 (0)