From 1edd84395ff753361204e66a33f0d763df0d3342 Mon Sep 17 00:00:00 2001 From: David Parker Date: Fri, 13 Feb 2026 16:23:30 +0000 Subject: [PATCH] [patch] Add unittest for PR 2067 --- python/test/test_baseapp.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 python/test/test_baseapp.py diff --git a/python/test/test_baseapp.py b/python/test/test_baseapp.py new file mode 100644 index 0000000000..9ed812b01e --- /dev/null +++ b/python/test/test_baseapp.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +# ***************************************************************************** +# Copyright (c) 2026 IBM Corporation and other Contributors. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# ***************************************************************************** + +import os +from mas.cli.cli import BaseApp +from prompt_toolkit.application import create_app_session +from prompt_toolkit.output import DummyOutput + + +def test_version(): + """ + Test that BaseApp.version matches the VERSION environment variable when set + """ + expected_version = "100.0.0-pre.local" + if 'VERSION' in os.environ: + expected_version = os.environ['VERSION'] + + with create_app_session(output=DummyOutput()): + app = BaseApp() + assert app.version == expected_version, f"Expected version {expected_version}, but got {app.version}"