Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
bryant1410 committed Nov 22, 2020
1 parent 47db4f9 commit ef3a61f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/test_datasets_video_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ def test_compute_clips_for_video(self):
self.assertTrue(clips.equal(idxs))
self.assertTrue(idxs.flatten().equal(resampled_idxs))

# case 3: frames aren't enough for a clip
num_frames = 32
orig_fps = 30
new_fps = 13
with self.assertWarns(UserWarning):
clips, idxs = VideoClips.compute_clips_for_video(video_pts, num_frames, num_frames,
orig_fps, new_fps)
self.assertEqual(len(clips), 0)
self.assertEqual(len(idxs), 0)


if __name__ == '__main__':
unittest.main()

0 comments on commit ef3a61f

Please sign in to comment.