diff --git a/tests/conftest.py b/tests/conftest.py index eeaaeac..7d3473b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,8 +1,7 @@ from pathlib import Path import pytest - -from .testdata.gen_data import main as gen_data_main +from specarray import SpecArray @pytest.fixture() diff --git a/tests/test_methods.py b/tests/test_methods.py index 1b61afa..c572761 100644 --- a/tests/test_methods.py +++ b/tests/test_methods.py @@ -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))