Last active
July 10, 2020 07:41
-
-
Save masouduut94/345d456d4e7f1e29cc3954aa05e43d98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_add_frame(self): | |
frames_ids = [1, 2, 3, 4, 5] | |
self.json_parser.set_top_k(0) | |
for frame_id in frames_ids: | |
self.json_parser.add_frame(frame_id) | |
output = self.json_parser.output() | |
output_ids = [frame['frame_id'] for frame in output['frames']] | |
for frame_id in frames_ids: | |
self.assertIn(frame_id, output_ids) | |
# if repeated frame id was inserted, raise ValueError | |
with self.assertRaisesRegex(ValueError, "Frame id: (.*?) already exists"): | |
self.json_parser.add_frame(frames_ids[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment