# Path: tests/data.py



import blimpy as bl
import pytest
from tests.data import voyager_fil, voyager_h5, here
    from blimpy.io.file_wrapper import open_file
    from blimpy.io.file_wrapper import open_file
    from blimpy.io.file_wrapper import open_file

def test_read_fns():
    """ These read functions are currently not implemented. """
    """ L: if that is true, why do the first two lines
        NOT raise NotImplementedError's?"""
    a = bl.Waterfall(voyager_fil)
    b = bl.Waterfall(voyager_h5)
    with pytest.raises(NotImplementedError):
        a.container.read_all()
        a.container.read_row(0)
        a.container.read_rows(0, 2)

        b.container.read_all()
        b.container.read_row(0)
        b.container.read_rows(0, 2)

def test_file_wrapper_open_h5_file():
    h5r = open_file(voyager_h5)

    # check all if branches
    h5r.populate_timestamps(update_header=False)
    h5r.populate_timestamps(update_header=True)
  
    with pytest.raises(ValueError):
        h5r.read_blob((300, 300, 300, 300), -1)        

    # testing to make sure all internal functions are already used
    h5r._setup_selection_range(
        f_start=3, f_stop=4, t_stop=3, t_start=4
    )

# Path: tests/data.py



# Path: tests/test_file_wrapper.py
import blimpy as bl
import pytest
from tests.data import voyager_fil, voyager_h5, here
    from blimpy.io.file_wrapper import open_file
    from blimpy.io.file_wrapper import open_file
    from blimpy.io.file_wrapper import open_file


def test_read_fns():
    """ These read functions are currently not implemented. """
    """ L: if that is true, why do the first two lines
        NOT raise NotImplementedError's?"""
    a = bl.Waterfall(voyager_fil)
    b = bl.Waterfall(voyager_h5)
    with pytest.raises(NotImplementedError):
        a.container.read_all()
        a.container.read_row(0)
        a.container.read_rows(0, 2)

        b.container.read_all()
        b.container.read_row(0)
        b.container.read_rows(0, 2)

def test_file_wrapper_open_h5_file():
    h5r = open_file(voyager_h5)

    # check all if branches
    h5r.populate_timestamps(update_header=False)
    h5r.populate_timestamps(update_header=True)
  
    with pytest.raises(ValueError):
        h5r.read_blob((300, 300, 300, 300), -1)        

    # testing to make sure all internal functions are already used
    h5r._setup_selection_range(
        f_start=3, f_stop=4, t_stop=3, t_start=4
    )

    h5r._setup_selection_range()    