[tests] nocover stuff that's just from the source module

This commit is contained in:
sneakers-the-rat 2023-10-05 21:39:15 -07:00
parent c215e69fd8
commit 033f6c434d
2 changed files with 2 additions and 15 deletions

View file

@ -266,7 +266,7 @@ class NWBPydanticGenerator(PydanticGenerator):
version = version_module_case(self.versions[schema_name]) version = version_module_case(self.versions[schema_name])
if self.split: if self.split:
local_mod_name = '...' + module_case(schema_name) + '.' + version + '.' + module_case(module_name) local_mod_name = '...' + module_case(schema_name) + '.' + version + '.' + module_case(module_name)
else: else: # pragma: no cover
local_mod_name = '...' + module_case(schema_name) + '.' + version + '.' + 'namespace' local_mod_name = '...' + module_case(schema_name) + '.' + version + '.' + 'namespace'
else: else:

View file

@ -165,7 +165,7 @@ def test_versions(linkml_schema):
core_str = NWBPydanticGenerator( core_str = NWBPydanticGenerator(
str(linkml_schema.core_path), str(linkml_schema.core_path),
versions={'imported': 'v4.2.0'}, versions={'imported': 'v4.2.0'},
split=False split=True
).serialize() ).serialize()
# the import should be like # the import should be like
@ -175,19 +175,6 @@ def test_versions(linkml_schema):
match = re.findall(r'from \.\.\.imported\.v4_2_0.*?MainThing.*?\)', core_str, flags=re.DOTALL) match = re.findall(r'from \.\.\.imported\.v4_2_0.*?MainThing.*?\)', core_str, flags=re.DOTALL)
assert len(match) == 1 assert len(match) == 1
core_str = NWBPydanticGenerator(
str(linkml_schema.core_path),
versions={'imported': 'v4.2.0'},
split=True
).serialize()
# the import should be like
# from ...imported.v4_2_0.namespace import (
# MainThing
# )
match = re.findall(r'from \.\.\.imported\.v4_2_0\.namespace.*?MainThing.*?\)', core_str, flags=re.DOTALL)
assert len(match) == 1
def test_arraylike(imported_schema): def test_arraylike(imported_schema):
""" """