Add project name and version context to SBOM file name - #948
Conversation
Co-authored-by: Ariel Schulz <43442541+ArBridgeman@users.noreply.github.com>
Co-authored-by: Ariel Schulz <43442541+ArBridgeman@users.noreply.github.com>
Co-authored-by: Ariel Schulz <43442541+ArBridgeman@users.noreply.github.com>
Co-authored-by: Ariel Schulz <43442541+ArBridgeman@users.noreply.github.com>
|
| test() | ||
|
|
||
|
|
||
| def test_project_name_and_version_from_poetry(): |
There was a problem hiding this comment.
Mocking this was a good instinct, as the exasol-toolbox version will change over time. However, as the python-toolbox is used in many projects, we often do a more direct test to ensure that the 3rd party code (in this case poetry version --ansi) works as expected and is parsed in a way we expect. This way if update poetry or dependencies change that we have clearer test feedback to act upon.
There was a problem hiding this comment.
So, I'd replace this test with:
from exasol.toolbox import __version__
def test_project_name_and_version_from_poetry():
name, version = project_name_and_version_from_poetry(
working_directory=PROJECT_CONFIG.root_path)
assert name == "exasol_toolbox"
assert version == Version.from_string(__version__)| def test_generate_sbom(monkeypatch, nox_session, tmp_path, test_project_config_factory): | ||
| project_config = test_project_config_factory(root_path=tmp_path) | ||
| monkeypatch.setattr(_dependencies, "PROJECT_CONFIG", project_config) | ||
| monkeypatch.setattr( |
| name, version = project_name_and_version_from_poetry() | ||
|
|
||
| assert name == "exasol_toolbox" | ||
| assert version == Version(10, 4, 0) |
There was a problem hiding this comment.
Otherwise, please add an entry for this issue in the doc/changes/unreleased.md file.



Fixes #946
Checklist
Note: If any of the items in the checklist are not relevant to your PR, just check the box.
For any Pull Request
Is the following correct:
When Changes Were Made
Did you:
When Preparing a Release
Have you: