-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
2 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
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 |
---|---|---|
@@ -1,3 +1,27 @@ | ||
from __future__ import annotations | ||
|
||
from specarray import SpecArray | ||
from pytest_check import check | ||
|
||
from xarray import DataArray | ||
|
||
|
||
def test_repr(testdata_specim: SpecArray): | ||
repr = testdata_specim.__repr__() | ||
print(repr) | ||
check.is_true(repr.startswith("SpecArray")) | ||
check.equal(len(repr), 5823) | ||
|
||
|
||
def test_len(testdata_specim: SpecArray): | ||
check.equal(len(testdata_specim), 2) | ||
|
||
|
||
def test_getitem(testdata_specim: SpecArray): | ||
check.equal(testdata_specim[0].shape, (1024, 448)) | ||
check.equal(testdata_specim[1].shape, (1024, 448)) | ||
check.is_instance(testdata_specim[0], DataArray) | ||
|
||
|
||
def test_shape(testdata_specim: SpecArray): | ||
check.equal(testdata_specim.shape, (2, 1024, 448)) |