DevOps-MBSE / AaC

Prototype Arch-as-Code
https://devops-mbse.github.io/AaC/
MIT License
28 stars 8 forks source link

🐛 [BUG] - The fully_qualified_name_to_class dictionary in Language Context seems to inconsistently have definitions mapped to their class names #887

Open bunchw opened 3 weeks ago

bunchw commented 3 weeks ago

Pre-requisites

What version of the AaC package are you using? Check your version with the command: aac version.

0.4.35

Description

When using the create_aac_enum method in LanguageContext, the context is supposed to pull the class name from a dictionary called fully_qualified_name_to_class. When trying to use this method in the tests, however, it is unable to find the class name for a given enum.

Reproduction URL

No response

Reproduction steps

Please enter an explicit description of your issue
1. Go to aac/python/tests/test_aac/context/test_language_context.py.
2. Scroll to line 41.
3. Uncomment out the commented-out code.  This is a test that should create an enum class from an enum in aac.aac.
4. Run unit tests.

Screenshots

If applicable, add screenshots to help explain your problem.
![DESCRIPTION](LINK.png)

Logs

Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.

Pertinent Files

Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.

bunchw commented 3 weeks ago
ERROR: test_create_aac_enum (tests.test_aac.context.test_language_context.TestLanguageContext)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/workspace/AaC/python/tests/test_aac/context/test_language_context.py", line 44, in test_create_aac_enum
    enum = context.create_aac_enum("RequirementVerificationMethod", "TEST")
  File "/workspace/AaC/python/src/aac/context/language_context.py", line 98, in create_aac_enum
    aac_class = self._get_aac_generated_class(aac_enum_name)
  File "/workspace/AaC/python/src/aac/context/language_context.py", line 58, in _get_aac_generated_class
    aac_class = self.context_instance.fully_qualified_name_to_class[
KeyError: 'aac.lang.RequirementVerificationMethod'

----------------------------------------------------------------------
Ran 144 tests in 4.730s

FAILED (errors=1)