mirror of
https://github.com/p2p-ld/nwb-linkml.git
synced 2024-11-12 17:54:29 +00:00
update tests
This commit is contained in:
parent
83dd59d30d
commit
6431afa7e5
2 changed files with 21 additions and 10 deletions
|
@ -154,10 +154,14 @@ class MapScalarAttributes(DatasetMap):
|
|||
name: rate
|
||||
description: Sampling rate, in Hz.
|
||||
range: float32
|
||||
required: true
|
||||
unit:
|
||||
name: unit
|
||||
description: Unit of measurement for time, which is fixed to 'seconds'.
|
||||
ifabsent: string(seconds)
|
||||
range: text
|
||||
required: true
|
||||
equals_string: seconds
|
||||
value:
|
||||
name: value
|
||||
range: float64
|
||||
|
@ -244,11 +248,15 @@ class MapListlike(DatasetMap):
|
|||
range: string
|
||||
required: true
|
||||
value:
|
||||
name: image
|
||||
name: value
|
||||
annotations:
|
||||
source_type:
|
||||
tag: source_type
|
||||
value: reference
|
||||
description: Ordered dataset of references to Image objects.
|
||||
multivalued: true
|
||||
range: Image
|
||||
required: true
|
||||
multivalued: true
|
||||
tree_root: true
|
||||
|
||||
"""
|
||||
|
@ -476,12 +484,14 @@ class MapArrayLikeAttributes(DatasetMap):
|
|||
name: resolution
|
||||
description: Pixel resolution of the image, in pixels per centimeter.
|
||||
range: float32
|
||||
required: false
|
||||
description:
|
||||
name: description
|
||||
description: Description of the image.
|
||||
range: text
|
||||
array:
|
||||
name: array
|
||||
required: false
|
||||
value:
|
||||
name: value
|
||||
range: numeric
|
||||
any_of:
|
||||
- array:
|
||||
|
|
|
@ -3,6 +3,7 @@ from linkml_runtime.linkml_model import SlotDefinition
|
|||
|
||||
from nwb_linkml.adapters import DatasetAdapter, GroupAdapter
|
||||
from nwb_schema_language import CompoundDtype, Dataset, Group, ReferenceDtype
|
||||
from nwb_linkml.maps.dtype import handle_dtype
|
||||
|
||||
|
||||
@pytest.mark.xfail()
|
||||
|
@ -89,7 +90,7 @@ def test_get_full_name():
|
|||
parent.cls.neurodata_type_def = None
|
||||
parent.cls.name = "ParentName"
|
||||
parent.parent = grandparent
|
||||
assert adapter._get_full_name() == "Grandparent__ParentName__ChildName"
|
||||
assert adapter._get_full_name() == "ParentName__ChildName"
|
||||
|
||||
# if it has none, raise value error
|
||||
adapter.cls.name = None
|
||||
|
@ -179,9 +180,9 @@ def test_handle_dtype(nwb_schema):
|
|||
CompoundDtype(name="reference", doc="reference!", dtype=reftype),
|
||||
]
|
||||
|
||||
assert cls.handle_dtype(reftype) == "TargetClass"
|
||||
assert cls.handle_dtype(None) == "AnyType"
|
||||
assert cls.handle_dtype([]) == "AnyType"
|
||||
assert handle_dtype(reftype) == "TargetClass"
|
||||
assert handle_dtype(None) == "AnyType"
|
||||
assert handle_dtype([]) == "AnyType"
|
||||
# handling compound types is currently TODO
|
||||
assert cls.handle_dtype(compoundtype) == "AnyType"
|
||||
assert cls.handle_dtype("int32") == "int32"
|
||||
assert handle_dtype(compoundtype) == "AnyType"
|
||||
assert handle_dtype("int32") == "int32"
|
||||
|
|
Loading…
Reference in a new issue