Skip to content

Commit

Permalink
tests: move identifier test to single tif format (did not work probab…
Browse files Browse the repository at this point in the history
…ly due to zipfile hash)
  • Loading branch information
paulmueller committed Jun 20, 2018
1 parent 4a7ccf4 commit bdc89f2
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/test_single_tif_holo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import pathlib

import qpformat


datapath = pathlib.Path(__file__).parent / "data"


def test_basic():
path = datapath / "single_holo.tif"
ds = qpformat.load_data(path)
# basic tests
assert ds.storage_type == "hologram"
assert not ds.is_series
assert ds.path == path
assert "SingleTifHolo" in ds.__repr__()


def test_identifier():
path = datapath / "single_holo.tif"
ds = qpformat.load_data(path, holo_kw={"sideband": 1})
assert ds.identifier == "e9d9d"


def test_load_data():
path = datapath / "single_holo.tif"
ds = qpformat.load_data(path)
# basic tests
qpi = ds.get_qpimage(0)
assert qpi.shape == (238, 267)


if __name__ == "__main__":
# Run all tests
loc = locals()
for key in list(loc.keys()):
if key.startswith("test_") and hasattr(loc[key], "__call__"):
loc[key]()

0 comments on commit bdc89f2

Please sign in to comment.