Skip to content

Commit bd45fe7

Browse files
committed
Add attribute test
1 parent 4effc58 commit bd45fe7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tiledb/tests/test_attribute.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_minimal_attribute(self):
2525
except:
2626
pytest.fail(f"Could not parse attr._repr_html_(). Saw {attr._repr_html_()}")
2727

28-
def test_attribute(self, capfd):
28+
def test_attribute_name_only(self, capfd):
2929
attr = tiledb.Attr("foo")
3030

3131
attr.dump()
@@ -198,6 +198,16 @@ def test_datetime_attribute(self):
198198
assert attr.dtype != np.dtype(np.datetime64("", "Y"))
199199
assert attr.dtype != np.dtype(np.datetime64)
200200

201+
@pytest.mark.parametrize("dtype", ["ascii", "blob", "wkb", "wkt"])
202+
def test_nonnumpy_dtype_attribute(self, dtype):
203+
# Do not test wkb/wkt if not yet implemented in linked libtiledb.
204+
if not hasattr(tiledb.cc.DataType, "GEOM_WKB") and (
205+
dtype == "wkb" or dtype == "wkt"
206+
):
207+
return
208+
attr = tiledb.Attr("non-numpy_dtype", dtype=dtype)
209+
self.assertEqual(attr, attr)
210+
201211
@pytest.mark.parametrize("sparse", [True, False])
202212
def test_ascii_attribute(self, sparse, capfd):
203213
path = self.path("test_ascii")

0 commit comments

Comments
 (0)