Skip to content

Commit

Permalink
test.model.test_concept.py: Added seperate test file for model.concep…
Browse files Browse the repository at this point in the history
…t.py including a test for ConceptDescription._set_category
  • Loading branch information
somsonson authored and s-heppner committed Jul 11, 2024
1 parent ce1568f commit ff35c4e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/model/test_concept.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2023 the Eclipse BaSyx Authors
#
# This program and the accompanying materials are made available under the terms of the MIT License, available in
# the LICENSE file of this project.
#
# SPDX-License-Identifier: MIT
import unittest

from basyx.aas.examples.data import example_aas
from basyx.aas import model


class ConceptDescriptionTest(unittest.TestCase):
def test_concept_description(self):
concept_description = example_aas.create_example_concept_description()

concept_description._set_category(category=None)
concept_description_category = concept_description.__dict__.get("_category")
self.assertEqual(concept_description_category, "PROPERTY")

concept_description._set_category(category="VALUE")
concept_description_category = concept_description.__dict__.get("_category")
self.assertEqual(concept_description_category, "VALUE")

with self.assertRaises(model.base.AASConstraintViolation):
concept_description._set_category(category="FORBIDDEN_CONCEPT_DESCRIPTION")

0 comments on commit ff35c4e

Please sign in to comment.