test_write
Comprehensive tests for gwframe write functionality.
TestAdcWrite ¶
Tests for writing ADC (FrAdcData) channels.
test_adc_framewriter ¶
Test writing ADC data through FrameWriter.
Source code in gwframe/tests/test_write.py
test_adc_integer_dtypes ¶
Test ADC write with integer data types (common for real ADC data).
Source code in gwframe/tests/test_write.py
test_adc_mixed_with_proc ¶
Test writing both proc and ADC channels in the same frame.
Source code in gwframe/tests/test_write.py
test_adc_read_frames_roundtrip ¶
Test that read_frames preserves ADC channel type on round-trip.
Source code in gwframe/tests/test_write.py
test_adc_with_compression ¶
Test ADC data write with different compression schemes.
Source code in gwframe/tests/test_write.py
test_adc_write_bytes_roundtrip ¶
Test writing ADC data to bytes and reading it back.
Source code in gwframe/tests/test_write.py
test_adc_write_file_roundtrip ¶
Test writing ADC data to file and reading it back.
Source code in gwframe/tests/test_write.py
test_adc_write_multiple_channels ¶
Test writing multiple ADC channels to a single frame.
Source code in gwframe/tests/test_write.py
TestCompression ¶
Tests for compression modes and settings.
test_compression_level ¶
Test compression with different compression levels.
Source code in gwframe/tests/test_write.py
test_compression_modes_exposed ¶
Test that all compression modes are exposed.
Source code in gwframe/tests/test_write.py
test_write_with_different_compressions ¶
Test writing with different compression modes.
Source code in gwframe/tests/test_write.py
TestFrameDictInterface ¶
Tests for the Frame MutableMapping interface (setitem, delitem).
test_setitem_delitem_triggers_rebuild_on_write ¶
Mutating a Frame via dict interface rebuilds the frame on write.
Source code in gwframe/tests/test_write.py
test_start_setter_updates_written_frame ¶
Reassigning Frame.start updates the GPS time of the written frame.
Source code in gwframe/tests/test_write.py
TestFrameMetadata ¶
Tests for frame metadata (detector, run, etc.).
test_frame_with_full_metadata ¶
Test creating frame with all metadata fields.
Source code in gwframe/tests/test_write.py
test_frame_without_detector ¶
Test creating frame without detector name.
Source code in gwframe/tests/test_write.py
TestFrameNumber ¶
Tests for frame number tracking and auto-increment.
test_default_frame_number ¶
test_explicit_frame_number ¶
Test creating frame with explicit frame_number.
test_framewriter_auto_increment ¶
Test FrameWriter auto-increments frame numbers.
Source code in gwframe/tests/test_write.py
test_manual_frame_objects_with_framewriter ¶
Test writing manual Frame objects with specific frame numbers.
Source code in gwframe/tests/test_write.py
TestFrameWriter ¶
Tests for FrameWriter context manager.
test_framewriter_multiple_channels ¶
Test writing multiple channels per frame.
Source code in gwframe/tests/test_write.py
test_framewriter_with_compression ¶
Test FrameWriter with compression.
Source code in gwframe/tests/test_write.py
test_write_multiple_frames ¶
Test writing multiple frames to a single file.
Source code in gwframe/tests/test_write.py
TestFrameWriterChannelValidation ¶
All frames in a GWF file must share one channel set.
The table of contents stores one position per frame for every channel, so differing channel sets are unrepresentable — historically this silently produced files with a corrupt TOC that readers hang on. The writer must reject the mismatch at write time instead.
test_channel_subset_raises ¶
Dropping a channel in a later frame is rejected.
Source code in gwframe/tests/test_write.py
test_different_channel_raises ¶
A second frame with a different channel name is rejected.
Source code in gwframe/tests/test_write.py
test_matching_channel_sets_ok ¶
Frames with identical channel sets write and read back.
Source code in gwframe/tests/test_write.py
test_reopen_resets_channel_set ¶
Reopening a writer starts a new file with a fresh channel set.
Source code in gwframe/tests/test_write.py
TestFrameWriterOpenClose ¶
Tests for FrameWriter open()/close() API.
test_close_is_idempotent ¶
Test that calling close() multiple times is safe.
Source code in gwframe/tests/test_write.py
test_open_close_bytesio ¶
Test open()/close() with BytesIO destination.
Source code in gwframe/tests/test_write.py
test_open_close_file ¶
Test writing frames using open()/close() instead of context manager.
Source code in gwframe/tests/test_write.py
test_open_when_already_open_raises ¶
Test that opening an already-open writer raises an error.
Source code in gwframe/tests/test_write.py
TestOutputFilePermissions ¶
Regression tests: written files must respect the process umask.
Output files are written via a temporary file that is renamed into place. When that temp file came from tempfile.mkstemp it was always created with mode 0600 regardless of umask, so frames ended up unreadable by group/other.
test_frame_write_respects_umask ¶
Frame.write() output should be 0644 under a 022 umask.
Source code in gwframe/tests/test_write.py
test_framewriter_respects_umask ¶
FrameWriter output should be 0644 under a 022 umask.
Source code in gwframe/tests/test_write.py
test_no_leftover_temp_files ¶
The temporary file is renamed away, leaving only the output file.
Source code in gwframe/tests/test_write.py
umask_022 ¶
TestSimpleWrite ¶
Tests for simple write operations using gwframe.write().
test_write_basic ¶
Test basic write and read-back.
Source code in gwframe/tests/test_write.py
test_write_with_compression ¶
Test writing with GZIP compression.
Source code in gwframe/tests/test_write.py
TestTranslateIOError ¶
The errno embedded in frameCPP messages becomes an OSError.
TestWriteBytes ¶
Tests for write_bytes functionality.
test_frame_write_bytes_roundtrip ¶
Test Frame.write_bytes() method.
Source code in gwframe/tests/test_write.py
test_frame_writer_bytesio ¶
Test FrameWriter with BytesIO destination.
Source code in gwframe/tests/test_write.py
test_frame_writer_bytesio_equals_file ¶
Test that FrameWriter produces identical output for file and BytesIO.
Source code in gwframe/tests/test_write.py
test_write_bytes_basic_roundtrip ¶
Test basic round-trip: write_bytes -> read_bytes.
Source code in gwframe/tests/test_write.py
test_write_bytes_equals_write_file ¶
Test that write_bytes produces identical output to write.
Source code in gwframe/tests/test_write.py
test_write_bytes_multiple_channels ¶
Test write_bytes with multiple channels.
Source code in gwframe/tests/test_write.py
test_write_bytes_with_compression ¶
Test write_bytes with different compression schemes.
Source code in gwframe/tests/test_write.py
TestWriteFailureHandling ¶
Discarding partial output and surfacing I/O failures as OSError.
test_add_channel_with_unknown_detector_prefix ¶
Channels with a non-detector prefix write without error (silent-skip).
Source code in gwframe/tests/test_write.py
test_add_channel_wrong_dimensions ¶
Test that adding non-1D data raises error.
Source code in gwframe/tests/test_write.py
test_framewriter_error_when_not_opened ¶
Test that FrameWriter raises error if used outside context manager.
Source code in gwframe/tests/test_write.py
test_framewriter_write_single_array_without_name ¶
Test FrameWriter.write() with single array but no name raises error.
Source code in gwframe/tests/test_write.py
test_unsupported_channel_type ¶
Test that unsupported channel_type raises error.
Source code in gwframe/tests/test_write.py
test_write_frame_without_context ¶
Test write_frame raises error outside context manager.
Source code in gwframe/tests/test_write.py
test_write_single_array_without_name_raises_error ¶
Test that writing single array without name parameter raises error.