def test_examplefile_has_no_runheader(): from protozfits import rawzfitsreader from protozfits import L0_pb2 rawzfitsreader.open(example_file_path + ':RunHeader') raw = rawzfitsreader.readEvent() assert raw < 0 header = L0_pb2.CameraRunHeader() with pytest.raises(TypeError): header.ParseFromString(raw)
def test_examplefile_has_no_runheader(): from protozfits import rawzfits from protozfits import L0_pb2 with pytest.raises(RuntimeError): ifits = rawzfits.ProtobufIFits( fname=example_file_path, tablename="RunHeader" ) assert ifits.num_rows() == EVENTS_IN_EXAMPLE_FILE raw = ifits.read_event() assert raw < 0 header = L0_pb2.CameraRunHeader() with pytest.raises(TypeError): header.ParseFromString(raw)