import importlib import pytest from pydantic import ValidationError from typer.testing import CliRunner from datadog_tools.cli.software_catalog import app from tests.integration import data runner = CliRunner() @pytest.fixture() def data_path(): with importlib.resources.path(data) as data_path: yield data_path def test_create_service_valid_definition(data_path): """Test the create-service command with a valid service definition.""" result = runner.invoke( app, [ "create-service", "--repository-url", "https://github.com/theorchard/ows-video", "--repository-path", f"{data_path}/service/valid", "--pipeline-url", "https://pipeline.theorchard.io/job/theorchard/job/ows-video/job/master/", "--dry-run", ], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" assert result.return_value == { "apiVersion": "v3", "kind": "service", "metadata": { "name": "ows-video", "description": "Does video stuff", "owner": "content-delivery-asset-management", "tags": [ "application_family:product-builder", "aws_service:fargate", "dockerized:true", "language_version:3.13", "metadata_origin:datadog-tools", "metadata_revision:unknown", "package_manager:pip", "parent_image_repo:086679231553.dkr.ecr.us-east-1.amazonaws.com/docker-parent-images", "parent_image_tag:python313", "prod_aws_account_id:437795906767", "public:false", "qa_aws_account_id:437795906767", "service_type:web", "terraformed:true", ], "links": [ { "name": "AWS Console (Prod - us-east-1)", "type": "other", "provider": "aws", "url": "https://us-east-1.console.aws.amazon.com/ecs/v2/clusters/prod-ows-video/services/prod-ows-video", }, { "name": "AWS Console (QA - us-east-1)", "type": "other", "provider": "aws", "url": "https://us-east-1.console.aws.amazon.com/ecs/v2/clusters/qa-ows-video/services/qa-ows-video", }, { "name": "CI/CD Pipeline", "type": "other", "provider": "jenkins", "url": "https://pipeline.theorchard.io/job/theorchard/job/ows-video/job/master/", }, { "name": "GitHub Repository", "type": "repo", "provider": "github", "url": "https://github.com/theorchard/ows-video", }, { "name": "Sentry Project (Prod)", "type": "other", "provider": "sentry", "url": "https://the-orchard.sentry.io/projects/prod-ows-video/", }, { "name": "Sentry Project (QA)", "type": "other", "provider": "sentry", "url": "https://the-orchard.sentry.io/projects/qa-ows-video/", }, { "name": "SonarQube Project", "type": "other", "provider": "sonarqube", "url": "https://prod-sonar.theorchard.io/dashboard?id=ows-video", }, { "name": "Swagger Spec", "type": "other", "url": "https://swagger.theorchard.io/service/ows-video", }, { "name": "Terraform Infra (Prod - 437795906767)", "provider": "github", "type": "repo", "url": "https://github.com/theorchard/terraform-infra/tree/master/prod/ows-video", }, { "name": "Terraform Infra (QA - 437795906767)", "provider": "github", "type": "repo", "url": "https://github.com/theorchard/terraform-infra/tree/master/qa/ows-video", }, { "name": "prod-ows-video RDS timeboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/ddt-9vb-hbc/prod-ows-video-rds-timeboard", }, { "name": "prod-ows-video screen dashboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/6cx-c4v-m48/prod-ows-video-screen-dashboard", }, { "name": "prod-ows-video timeseries dashboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/hqa-tzj-695/prod-ows-video-timeseries-dashboard", }, { "name": "qa-ows-video screen dashboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/nat-qyx-49h/qa-ows-video-screen-dashboard", }, { "name": "qa-ows-video timeseries dashboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/cn4-sik-u5f/qa-ows-video-timeseries-dashboard", }, ], }, "datadog": {"codeLocations": [{"repositoryURL": "https://github.com/theorchard/ows-video", "paths": ["**"]}]}, "spec": {"languages": ["python"], "type": "web"}, "extensions": { "sonymusic-pde.com/metadata-source": { "pipelineURL": "https://pipeline.theorchard.io/job/theorchard/job/ows-video/job/master/", "repositoryPath": f"{data_path}/service/valid", "repositoryURL": "https://github.com/theorchard/ows-video", "revision": "unknown", "servicePath": "", } }, } def test_create_service_valid_definition_with_service_definition_file_path(data_path): """Test the create-service command with a valid service definition.""" result = runner.invoke( app, [ "create-service", "--repository-url", "https://github.com/theorchard/ows-video", "--repository-path", f"{data_path}/service/valid", "--service-definition-file-path", "service-definition-file-path.yaml", "--pipeline-url", "https://pipeline.theorchard.io/job/theorchard/job/ows-video/job/master/", "--dry-run", ], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" assert result.return_value == { "apiVersion": "v3", "kind": "service", "metadata": { "name": "ows-video", "description": "Does video stuff", "owner": "content-delivery-asset-management", "tags": [ "application_family:product-builder", "aws_service:fargate", "dockerized:true", "language_version:3.13", "metadata_origin:datadog-tools", "metadata_revision:unknown", "package_manager:pip", "parent_image_repo:086679231553.dkr.ecr.us-east-1.amazonaws.com/docker-parent-images", "parent_image_tag:python313", "prod_aws_account_id:437795906767", "public:false", "qa_aws_account_id:437795906767", "service_definition_file_path:true", # This tag is the only unique data from the custom file "service_type:web", "terraformed:true", ], "links": [ { "name": "AWS Console (Prod - us-east-1)", "type": "other", "provider": "aws", "url": "https://us-east-1.console.aws.amazon.com/ecs/v2/clusters/prod-ows-video/services/prod-ows-video", }, { "name": "AWS Console (QA - us-east-1)", "type": "other", "provider": "aws", "url": "https://us-east-1.console.aws.amazon.com/ecs/v2/clusters/qa-ows-video/services/qa-ows-video", }, { "name": "CI/CD Pipeline", "type": "other", "provider": "jenkins", "url": "https://pipeline.theorchard.io/job/theorchard/job/ows-video/job/master/", }, { "name": "GitHub Repository", "type": "repo", "provider": "github", "url": "https://github.com/theorchard/ows-video", }, { "name": "Sentry Project (Prod)", "type": "other", "provider": "sentry", "url": "https://the-orchard.sentry.io/projects/prod-ows-video/", }, { "name": "Sentry Project (QA)", "type": "other", "provider": "sentry", "url": "https://the-orchard.sentry.io/projects/qa-ows-video/", }, { "name": "SonarQube Project", "type": "other", "provider": "sonarqube", "url": "https://prod-sonar.theorchard.io/dashboard?id=ows-video", }, { "name": "Swagger Spec", "type": "other", "url": "https://swagger.theorchard.io/service/ows-video", }, { "name": "Terraform Infra (Prod - 437795906767)", "provider": "github", "type": "repo", "url": "https://github.com/theorchard/terraform-infra/tree/master/prod/ows-video", }, { "name": "Terraform Infra (QA - 437795906767)", "provider": "github", "type": "repo", "url": "https://github.com/theorchard/terraform-infra/tree/master/qa/ows-video", }, { "name": "prod-ows-video RDS timeboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/ddt-9vb-hbc/prod-ows-video-rds-timeboard", }, { "name": "prod-ows-video screen dashboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/6cx-c4v-m48/prod-ows-video-screen-dashboard", }, { "name": "prod-ows-video timeseries dashboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/hqa-tzj-695/prod-ows-video-timeseries-dashboard", }, { "name": "qa-ows-video screen dashboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/nat-qyx-49h/qa-ows-video-screen-dashboard", }, { "name": "qa-ows-video timeseries dashboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/cn4-sik-u5f/qa-ows-video-timeseries-dashboard", }, ], }, "datadog": {"codeLocations": [{"repositoryURL": "https://github.com/theorchard/ows-video", "paths": ["**"]}]}, "spec": {"languages": ["python"], "type": "web"}, "extensions": { "sonymusic-pde.com/metadata-source": { "pipelineURL": "https://pipeline.theorchard.io/job/theorchard/job/ows-video/job/master/", "repositoryPath": f"{data_path}/service/valid", "repositoryURL": "https://github.com/theorchard/ows-video", "revision": "unknown", "servicePath": "", "serviceDefinitionFilePath": "service-definition-file-path.yaml", } }, } def test_create_service_valid_definition_with_service_path(data_path): """Test the create-service command with a valid service definition in a subdirectory.""" result = runner.invoke( app, [ "create-service", "--repository-url", "https://github.com/theorchard/ows-video", "--repository-path", data_path, "--service-path", "service/valid", "--pipeline-url", "https://pipeline.theorchard.io/job/theorchard/job/ows-video/job/master/", "--dry-run", ], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" assert result.return_value == { "apiVersion": "v3", "kind": "service", "metadata": { "name": "ows-video", "description": "Does video stuff", "owner": "content-delivery-asset-management", "tags": [ "application_family:product-builder", "aws_service:fargate", "dockerized:true", "language_version:3.13", "metadata_origin:datadog-tools", "metadata_revision:unknown", "package_manager:pip", "parent_image_repo:086679231553.dkr.ecr.us-east-1.amazonaws.com/docker-parent-images", "parent_image_tag:python313", "prod_aws_account_id:437795906767", "public:false", "qa_aws_account_id:437795906767", "service_type:web", "terraformed:true", ], "links": [ { "name": "AWS Console (Prod - us-east-1)", "type": "other", "provider": "aws", "url": "https://us-east-1.console.aws.amazon.com/ecs/v2/clusters/prod-ows-video/services/prod-ows-video", }, { "name": "AWS Console (QA - us-east-1)", "type": "other", "provider": "aws", "url": "https://us-east-1.console.aws.amazon.com/ecs/v2/clusters/qa-ows-video/services/qa-ows-video", }, { "name": "CI/CD Pipeline", "type": "other", "provider": "jenkins", "url": "https://pipeline.theorchard.io/job/theorchard/job/ows-video/job/master/", }, { "name": "GitHub Repository", "type": "repo", "provider": "github", "url": "https://github.com/theorchard/ows-video", }, { "name": "Sentry Project (Prod)", "type": "other", "provider": "sentry", "url": "https://the-orchard.sentry.io/projects/prod-ows-video/", }, { "name": "Sentry Project (QA)", "type": "other", "provider": "sentry", "url": "https://the-orchard.sentry.io/projects/qa-ows-video/", }, { "name": "SonarQube Project", "type": "other", "provider": "sonarqube", "url": "https://prod-sonar.theorchard.io/dashboard?id=ows-video", }, { "name": "Swagger Spec", "type": "other", "url": "https://swagger.theorchard.io/service/ows-video", }, { "name": "Terraform Infra (Prod - 437795906767)", "provider": "github", "type": "repo", "url": "https://github.com/theorchard/terraform-infra/tree/master/prod/ows-video", }, { "name": "Terraform Infra (QA - 437795906767)", "provider": "github", "type": "repo", "url": "https://github.com/theorchard/terraform-infra/tree/master/qa/ows-video", }, { "name": "prod-ows-video RDS timeboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/ddt-9vb-hbc/prod-ows-video-rds-timeboard", }, { "name": "prod-ows-video screen dashboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/6cx-c4v-m48/prod-ows-video-screen-dashboard", }, { "name": "prod-ows-video timeseries dashboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/hqa-tzj-695/prod-ows-video-timeseries-dashboard", }, { "name": "qa-ows-video screen dashboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/nat-qyx-49h/qa-ows-video-screen-dashboard", }, { "name": "qa-ows-video timeseries dashboard", "type": "dashboard", "url": "https://sonymusic-pde.datadoghq.com/dashboard/cn4-sik-u5f/qa-ows-video-timeseries-dashboard", }, ], }, "datadog": { "codeLocations": [ {"repositoryURL": "https://github.com/theorchard/ows-video", "paths": ["service/valid/**"]} ] }, "spec": {"languages": ["python"], "type": "web"}, "extensions": { "sonymusic-pde.com/metadata-source": { "pipelineURL": "https://pipeline.theorchard.io/job/theorchard/job/ows-video/job/master/", "repositoryPath": str(data_path), "repositoryURL": "https://github.com/theorchard/ows-video", "revision": "unknown", "servicePath": "service/valid", } }, } def test_create_service_determines_language_metadata_from_unknown_parent_image(data_path): result = runner.invoke( app, [ "create-service", "--repository-url", "https://github.com/theorchard/ows-video", "--repository-path", f"{data_path}/service/valid_with_unknown_parent_image", "--pipeline-url", "https://pipeline.theorchard.io/job/theorchard/job/ows-video/job/master/", "--dry-run", ], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" assert result.return_value["spec"]["languages"] == ["java"] assert "language_version:21" in result.return_value["metadata"]["tags"] def test_create_service_determines_language_metadata_from_unknown_private_aws_parent_image(data_path): result = runner.invoke( app, [ "create-service", "--repository-url", "https://github.com/theorchard/ows-video", "--repository-path", f"{data_path}/service/valid_with_unknown_private_aws_parent_image", "--pipeline-url", "https://pipeline.theorchard.io/job/theorchard/job/ows-video/job/master/", "--dry-run", ], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" assert result.return_value["spec"]["languages"] == ["python"] assert "language_version:3.14" in result.return_value["metadata"]["tags"] def test_validate_service_valid_definition(data_path): """Test the validate-service command with a valid service definition.""" result = runner.invoke( app, [ "validate-service", "--repository-path", f"{data_path}/service/valid", ], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" def test_validate_service_valid_definition_with_service_path(data_path): """Test the validate-service command with a valid service definition in a subdirectory.""" result = runner.invoke( app, [ "validate-service", "--repository-path", data_path, "--service-path", "service/valid", ], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" def test_validate_service_invalid_definition(data_path): """Test the validate-service command with an invalid service definition.""" result = runner.invoke( app, [ "validate-service", "--repository-path", f"{data_path}/service/invalid", ], standalone_mode=False, ) assert result.exit_code != 0 assert isinstance(result.exception, ValidationError) assert result.exception.error_count() == 1 assert result.exception.errors()[0]["type"] == "missing" assert result.exception.errors()[0]["loc"] == ("metadata", "description") def test_validate_service_valid_definition_with_inheritance(data_path): """Test the validate-service command with a valid service definition that uses inheritance.""" result = runner.invoke( app, [ "validate-service", "--repository-path", f"{data_path}/service/valid_with_inheritance", ], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" def test_create_library_valid_definition(data_path): """Test the create-library command with a valid library definition.""" result = runner.invoke( app, [ "create-library", "--repository-url", "https://github.com/theorchard/python-ows-assets-uploader", "--repository-path", f"{data_path}/library/valid", "--pipeline-url", "https://pipeline.theorchard.io/job/theorchard/job/python-ows-assets-uploader/job/master/", "--dry-run", ], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" assert result.return_value == { "apiVersion": "v3", "kind": "library", "metadata": { "name": "python-ows-assets-uploader", "description": "Python library for uploading assets via ows-assets", "owner": "content-delivery-asset-management", "tags": [ "library_type:utility", "metadata_origin:datadog-tools", "metadata_revision:unknown", "package_manager:pip", ], "links": [ { "name": "CI/CD Pipeline", "type": "other", "provider": "jenkins", "url": "https://pipeline.theorchard.io/job/theorchard/job/python-ows-assets-uploader/job/master/", }, { "name": "GitHub Repository", "type": "repo", "provider": "github", "url": "https://github.com/theorchard/python-ows-assets-uploader", }, ], }, "datadog": { "codeLocations": [ {"repositoryURL": "https://github.com/theorchard/python-ows-assets-uploader", "paths": ["**"]} ] }, "spec": {"languages": ["python"], "type": "utility", "lifecycle": "production"}, "extensions": { "sonymusic-pde.com/metadata-source": { "pipelineURL": "https://pipeline.theorchard.io/job/theorchard/job/python-ows-assets-uploader/job/master/", "repositoryPath": f"{data_path}/library/valid", "repositoryURL": "https://github.com/theorchard/python-ows-assets-uploader", "revision": "unknown", "libraryPath": "", } }, } def test_create_library_valid_definition_with_library_definition_file_path(data_path): """Test the create-library command with a valid library definition.""" result = runner.invoke( app, [ "create-library", "--repository-url", "https://github.com/theorchard/python-ows-assets-uploader", "--repository-path", f"{data_path}/library/valid", "--library-definition-file-path", "library-definition-file-path.yaml", "--pipeline-url", "https://pipeline.theorchard.io/job/theorchard/job/python-ows-assets-uploader/job/master/", "--dry-run", ], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" assert result.return_value == { "apiVersion": "v3", "kind": "library", "metadata": { "name": "python-ows-assets-uploader", "description": "Python library for uploading assets via ows-assets", "owner": "content-delivery-asset-management", "tags": [ "library_definition_file_path:true", # This tag is the only unique data from the custom file "library_type:utility", "metadata_origin:datadog-tools", "metadata_revision:unknown", "package_manager:pip", ], "links": [ { "name": "CI/CD Pipeline", "type": "other", "provider": "jenkins", "url": "https://pipeline.theorchard.io/job/theorchard/job/python-ows-assets-uploader/job/master/", }, { "name": "GitHub Repository", "type": "repo", "provider": "github", "url": "https://github.com/theorchard/python-ows-assets-uploader", }, ], }, "datadog": { "codeLocations": [ {"repositoryURL": "https://github.com/theorchard/python-ows-assets-uploader", "paths": ["**"]} ] }, "spec": {"languages": ["python"], "type": "utility", "lifecycle": "production"}, "extensions": { "sonymusic-pde.com/metadata-source": { "pipelineURL": "https://pipeline.theorchard.io/job/theorchard/job/python-ows-assets-uploader/job/master/", "repositoryPath": f"{data_path}/library/valid", "repositoryURL": "https://github.com/theorchard/python-ows-assets-uploader", "revision": "unknown", "libraryPath": "", "libraryDefinitionFilePath": "library-definition-file-path.yaml", } }, } def test_create_library_valid_definition_with_library_path(data_path): """Test the create-library command with a valid library definition in a subdirectory.""" result = runner.invoke( app, [ "create-library", "--repository-url", "https://github.com/theorchard/python-ows-assets-uploader", "--repository-path", data_path, "--library-path", "library/valid", "--pipeline-url", "https://pipeline.theorchard.io/job/theorchard/job/python-ows-assets-uploader/job/master/", "--dry-run", ], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" assert result.return_value == { "apiVersion": "v3", "kind": "library", "metadata": { "name": "python-ows-assets-uploader", "description": "Python library for uploading assets via ows-assets", "owner": "content-delivery-asset-management", "tags": [ "library_type:utility", "metadata_origin:datadog-tools", "metadata_revision:unknown", "package_manager:pip", ], "links": [ { "name": "CI/CD Pipeline", "type": "other", "provider": "jenkins", "url": "https://pipeline.theorchard.io/job/theorchard/job/python-ows-assets-uploader/job/master/", }, { "name": "GitHub Repository", "type": "repo", "provider": "github", "url": "https://github.com/theorchard/python-ows-assets-uploader", }, ], }, "datadog": { "codeLocations": [ { "repositoryURL": "https://github.com/theorchard/python-ows-assets-uploader", "paths": ["library/valid/**"], } ] }, "spec": {"languages": ["python"], "type": "utility", "lifecycle": "production"}, "extensions": { "sonymusic-pde.com/metadata-source": { "pipelineURL": "https://pipeline.theorchard.io/job/theorchard/job/python-ows-assets-uploader/job/master/", "repositoryPath": str(data_path), "repositoryURL": "https://github.com/theorchard/python-ows-assets-uploader", "revision": "unknown", "libraryPath": "library/valid", } }, } def test_validate_library_valid_definition(data_path): """Test the validate-library command with a valid library definition.""" result = runner.invoke( app, [ "validate-library", "--repository-path", f"{data_path}/library/valid", ], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" def test_validate_library_valid_definition_with_library_path(data_path): """Test the validate-library command with a valid library definition in a subdirectory.""" result = runner.invoke( app, [ "validate-library", "--repository-path", data_path, "--library-path", "library/valid", ], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" def test_validate_library_invalid_definition(data_path): """Test the validate-library command with an invalid library definition.""" result = runner.invoke( app, [ "validate-library", "--repository-path", f"{data_path}/library/invalid", ], standalone_mode=False, ) assert result.exit_code != 0 assert isinstance(result.exception, ValidationError) assert result.exception.error_count() == 1 assert result.exception.errors()[0]["type"] == "missing" assert result.exception.errors()[0]["loc"] == ("metadata", "description") def test_list_services(): """Test the list-services command.""" result = runner.invoke( app, ["list-services"], standalone_mode=False, ) result_raw = runner.invoke( app, ["list-services", "--raw"], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" assert result_raw.exit_code == 0, ( f"Command failed with exit code {result_raw.exit_code}:\nException: {result_raw.exception}" ) assert len(result.return_value) > 0 assert len(result_raw.return_value) >= len(result.return_value) def test_list_libraries(): """Test the list-libraries command.""" result = runner.invoke( app, ["list-libraries"], standalone_mode=False, ) result_raw = runner.invoke( app, ["list-libraries", "--raw"], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" assert result_raw.exit_code == 0, ( f"Command failed with exit code {result_raw.exit_code}:\nException: {result_raw.exception}" ) # No libraries in the software catalog at the moment # assert len(result.return_value) > 0 assert len(result_raw.return_value) >= len(result.return_value) def test_list_systems(): """Test the list-systems command.""" result = runner.invoke( app, ["list-systems"], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" assert len(result.return_value) > 0 def test_get_service(): """Test the get-service command.""" result = runner.invoke( app, ["get-service", "--name", "ows-video"], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" assert result.return_value["metadata"]["name"] == "ows-video" def test_get_library(): """Test the get-library command.""" # No libraries in the software catalog at the moment pass def test_get_system(): """Test the get-system command.""" result = runner.invoke( app, ["get-system", "--name", "IOC"], standalone_mode=False, ) assert result.exit_code == 0, f"Command failed with exit code {result.exit_code}:\nException: {result.exception}" assert result.return_value["metadata"]["name"] == "IOC"