Skip to content

Commit

Permalink
Fix test_load_all.py for Primitive, CIMDatatype, EnumType
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Günther <tom@toms-cafe.de>
tom-hg57 committed Nov 25, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
DigitalBrains1 Peter Lebbing
1 parent d250fea commit 143ad32
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test_load_all.py
Original file line number Diff line number Diff line change
@@ -3,11 +3,14 @@
# SPDX-License-Identifier: Apache-2.0

import importlib
from enum import EnumType
from pathlib import Path
from typing import Iterator

import pytest

from pycgmes.utils.datatypes import CIMDatatype, Primitive


def get_all_resources() -> Iterator[str]:
resource_dir = Path(__file__).parent.parent / "pycgmes" / "resources"
@@ -22,5 +25,7 @@ class TestLoadAll:
def test_importing(self, resource):
mod = importlib.import_module(f".{resource}", package="pycgmes.resources")
# Calling possible profiles to have full coverage.
profiles = getattr(mod, resource)().possible_profiles
assert profiles
cls = getattr(mod, resource)
if type(cls) not in (Primitive, CIMDatatype, EnumType):
profiles = cls().possible_profiles
assert profiles

0 comments on commit 143ad32

Please sign in to comment.