Skip to content

Commit bc37fa8

Browse files
committed
#156 Update test for specs module
1 parent cb005b1 commit bc37fa8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/test_specs.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55

66
# dependencies
77
import numpy as np
8+
import xarray as xr
89
from typing_extensions import Annotated as Ann
910
from typing_extensions import Literal as L
10-
from xarray_dataclasses.specs import DataSpec
11+
from xarray_dataclasses.specs import DataOptions, DataSpec
1112
from xarray_dataclasses.typing import Attr, Coordof, Data, Name
1213

1314

@@ -171,3 +172,10 @@ def test_name() -> None:
171172
assert spec.role == "name"
172173
assert spec.type is str
173174
assert spec.default == "weather"
175+
176+
177+
def test_dataoptions() -> None:
178+
options = DataOptions(xr.DataArray)
179+
180+
assert DataSpec().options.factory is type(None)
181+
assert DataSpec(options=options).options.factory is xr.DataArray

0 commit comments

Comments
 (0)