-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: move identifier test to single tif format (did not work probab…
…ly due to zipfile hash)
- Loading branch information
1 parent
4a7ccf4
commit bdc89f2
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]() |