STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
backend.test_video Namespace Reference

Functions

bytes box (bytes kind, bytes payload)
bytes mp4 (float seconds, int version=0, int scale=1000, bytes tail=b"")
float epoch (y, mo, d, h, mi, s)
 rec_dir (tmp_path, monkeypatch)
None put (rec_dir, str folder, str stream, float seconds)
 test_duration_from_mvhd_v0_and_v1 (tmp_path)
 test_duration_none_for_unfinished_or_foreign_files (tmp_path)
bytes trak (bytes handler, int scale, int dur, int samples)
 test_frame_period_from_the_video_track (tmp_path)
 test_record_starts_at_its_name_save_ends_at_its_name (rec_dir)
 test_folder_name_is_read_in_the_gateway_zone_not_utc (rec_dir)
 test_listing_skips_what_is_not_a_finished_clip (rec_dir)
 test_no_mount_means_no_clips (monkeypatch, tmp_path)
None put_timing (rec_dir, folder, stream, timing)
 test_timing_file_places_the_clip_exactly_and_spans_its_gap (rec_dir)
 test_gateway_clock_offset_is_taken_off_so_clips_sit_on_the_daq_clock (rec_dir)
 test_no_measured_offset_means_the_clocks_are_taken_as_equal (rec_dir)
 test_a_timing_file_that_does_not_parse_falls_back_to_the_name (rec_dir, bad)
 test_approximate_clip_serves_one_piece (rec_dir)
 test_overlap_keeps_partial_clips_and_drops_outside_ones (rec_dir)
 client (rec_dir, monkeypatch)
 test_run_video_lists_overlapping_clips (client, rec_dir)
 test_run_video_without_mount_says_unavailable (client, monkeypatch)
 test_run_video_unindexed_is_409 (client)
 test_clip_served_with_range (client, rec_dir)
 test_clip_is_not_stored_by_a_shared_cache (client, rec_dir)
 test_clip_refuses_anything_not_listed (client, rec_dir, path)

Variables

str TZ = "America/Los_Angeles"

Detailed Description

Video clips on a run's timeline: listing, matching, and serving.

Run: cd webviewer && .venv/bin/python -m pytest backend/test_video.py -q

Function Documentation

◆ box()

bytes backend.test_video.box ( bytes kind,
bytes payload )

◆ client()

backend.test_video.client ( rec_dir,
monkeypatch )

Definition at line 225 of file test_video.py.

References epoch().

◆ epoch()

◆ mp4()

bytes backend.test_video.mp4 ( float seconds,
int version = 0,
int scale = 1000,
bytes tail = b"" )

◆ put()

◆ put_timing()

◆ rec_dir()

backend.test_video.rec_dir ( tmp_path,
monkeypatch )

Definition at line 38 of file test_video.py.

◆ test_a_timing_file_that_does_not_parse_falls_back_to_the_name()

backend.test_video.test_a_timing_file_that_does_not_parse_falls_back_to_the_name ( rec_dir,
bad )

Definition at line 193 of file test_video.py.

References epoch(), and put().

◆ test_approximate_clip_serves_one_piece()

backend.test_video.test_approximate_clip_serves_one_piece ( rec_dir)

Definition at line 201 of file test_video.py.

References put().

◆ test_clip_is_not_stored_by_a_shared_cache()

backend.test_video.test_clip_is_not_stored_by_a_shared_cache ( client,
rec_dir )

Definition at line 273 of file test_video.py.

References put(), and split().

◆ test_clip_refuses_anything_not_listed()

backend.test_video.test_clip_refuses_anything_not_listed ( client,
rec_dir,
path )

Definition at line 294 of file test_video.py.

References mp4(), and put().

◆ test_clip_served_with_range()

backend.test_video.test_clip_served_with_range ( client,
rec_dir )

Definition at line 260 of file test_video.py.

References mp4().

◆ test_duration_from_mvhd_v0_and_v1()

backend.test_video.test_duration_from_mvhd_v0_and_v1 ( tmp_path)

Definition at line 54 of file test_video.py.

References mp4().

◆ test_duration_none_for_unfinished_or_foreign_files()

backend.test_video.test_duration_none_for_unfinished_or_foreign_files ( tmp_path)

Definition at line 61 of file test_video.py.

References box(), and mp4().

◆ test_folder_name_is_read_in_the_gateway_zone_not_utc()

backend.test_video.test_folder_name_is_read_in_the_gateway_zone_not_utc ( rec_dir)

Definition at line 106 of file test_video.py.

References put().

◆ test_frame_period_from_the_video_track()

backend.test_video.test_frame_period_from_the_video_track ( tmp_path)

Definition at line 78 of file test_video.py.

References box(), mp4(), and trak().

◆ test_gateway_clock_offset_is_taken_off_so_clips_sit_on_the_daq_clock()

backend.test_video.test_gateway_clock_offset_is_taken_off_so_clips_sit_on_the_daq_clock ( rec_dir)

Definition at line 157 of file test_video.py.

References epoch(), put(), and put_timing().

◆ test_listing_skips_what_is_not_a_finished_clip()

backend.test_video.test_listing_skips_what_is_not_a_finished_clip ( rec_dir)

Definition at line 113 of file test_video.py.

References mp4(), and put().

◆ test_no_measured_offset_means_the_clocks_are_taken_as_equal()

backend.test_video.test_no_measured_offset_means_the_clocks_are_taken_as_equal ( rec_dir)

Definition at line 175 of file test_video.py.

References epoch(), put(), and put_timing().

◆ test_no_mount_means_no_clips()

backend.test_video.test_no_mount_means_no_clips ( monkeypatch,
tmp_path )

Definition at line 125 of file test_video.py.

◆ test_overlap_keeps_partial_clips_and_drops_outside_ones()

backend.test_video.test_overlap_keeps_partial_clips_and_drops_outside_ones ( rec_dir)

Definition at line 210 of file test_video.py.

References epoch(), and put().

◆ test_record_starts_at_its_name_save_ends_at_its_name()

backend.test_video.test_record_starts_at_its_name_save_ends_at_its_name ( rec_dir)

Definition at line 94 of file test_video.py.

References epoch(), and put().

◆ test_run_video_lists_overlapping_clips()

backend.test_video.test_run_video_lists_overlapping_clips ( client,
rec_dir )

Definition at line 237 of file test_video.py.

References put().

◆ test_run_video_unindexed_is_409()

backend.test_video.test_run_video_unindexed_is_409 ( client)

Definition at line 255 of file test_video.py.

◆ test_run_video_without_mount_says_unavailable()

backend.test_video.test_run_video_without_mount_says_unavailable ( client,
monkeypatch )

Definition at line 249 of file test_video.py.

◆ test_timing_file_places_the_clip_exactly_and_spans_its_gap()

backend.test_video.test_timing_file_places_the_clip_exactly_and_spans_its_gap ( rec_dir)

Definition at line 139 of file test_video.py.

References epoch(), put(), and put_timing().

◆ trak()

bytes backend.test_video.trak ( bytes handler,
int scale,
int dur,
int samples )

Definition at line 70 of file test_video.py.

References box().

Referenced by test_frame_period_from_the_video_track().

Variable Documentation

◆ TZ

str backend.test_video.TZ = "America/Los_Angeles"

Definition at line 16 of file test_video.py.