-
Notifications
You must be signed in to change notification settings - Fork 6
Extend CLI functions #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/samm_cli_functions.py
Outdated
Show resolved
Hide resolved
c7dd3ff to
089cabb
Compare
core/esmf-aspect-meta-model-python/tests/integration/test_cli_functions.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/samm_cli_functions.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/samm_cli_functions.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/samm_cli_functions.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/tests/unit/test_samm_cli_functions.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/samm_cli_functions.py
Outdated
Show resolved
Hide resolved
| check=True, | ||
| ) | ||
|
|
||
| @pytest.mark.parametrize("command_type", ("aspect", "aas", "package", "QWE")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a test for incorrect command_type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test also can be move to the functional testing suitre
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to clarify the type of tests I’ve written. The current tests are unit tests, not functional tests.
- They target small helper methods like
_format_argumentand_process_kwargs. - All external dependencies are mocked (e.g.,
subprocess,_get_client_path), so the tests run in isolation. - Each test verifies only the logic of a single method and its return value.
By contrast, functional tests usually check a business scenario end-to-end, often without mocking, to ensure multiple components work together (e.g., calling the real CLI command and verifying the actual output).
Because these tests focus on isolated pieces of code, they fit the definition of unit tests.
➡️ My opinion is that we can simply keep them as part of our unit tests. There’s nothing wrong if I additionally tested a function more thoroughly — it’s not redundant, and having extra unit coverage will only help us.
Could you share your thoughts on this?
core/esmf-aspect-meta-model-python/tests/unit/test_samm_cli_functions.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/tests/integration/test_cli_functions.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/tests/integration/test_cli_functions.py
Show resolved
Hide resolved
3681510 to
4984770
Compare
core/esmf-aspect-meta-model-python/tests/integration/test_cli_functions.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/tests/integration/test_cli_functions.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/tests/integration/test_cli_functions.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/tests/integration/pymodels/__init__.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/samm_cli_functions.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/samm_cli_functions.py
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/samm_cli_functions.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/tests/unit/test_samm_cli_functions.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/tests/unit/test_samm_cli_functions.py
Outdated
Show resolved
Hide resolved
core/esmf-aspect-meta-model-python/tests/integration/pymodels/__init__.py
Outdated
Show resolved
Hide resolved
98edb79 to
1af7f0e
Compare
| @prefix : <urn:samm:org.eclipse.esmf.test.general:2.1.0#> . | ||
|
|
||
| :Aspect a samm:Aspect ; | ||
| :TestAspect a samm:Aspect ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Aspect should have the same name as the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve renamed it to SampleAspect.ttl
* prettyprint: Format Aspect Model files * to_java: Generate Java classes from Aspect Models * to_asyncapi: Generate AsyncAPI specifications * to_jsonld: Generate JSON-LD representations * to_sql: Generate SQL scripts for Aspect data * to_aas: Generate Asset Administration Shell templates * edit_move: Move model elements between files/namespaces * edit_newversion: Create new versions of models * usage: Show where model elements are used * aas_to_aspect: Convert AAS templates to Aspect Models * aas_list: List submodel templates in AAS files * package_import: Import namespace packages * package_export: Export models as namespace packages - Enhance _call_function method to support different command types (aspect, aas, package) - Add support for repeated parameters (lists in kwargs) - Add integration test suite that: * Tests all possible model transformations * Verifies output file validity * Tests language-specific outputs * Tests package export/import functionality * Uses realistic test Aspect Model
1af7f0e to
aba7c62
Compare
Description
Extend SAMM CLI with new functions + test coverage:
Type of change
Checklist: