From dea5d643a3ea85318b876e96fa045cefbe944097 Mon Sep 17 00:00:00 2001 From: Jusuf Date: Fri, 6 Dec 2024 09:49:19 +0100 Subject: [PATCH] Add tests for Astarte interface validation - Add test to validate Astarte interfaces using astartectl Signed-off-by: Jusuf --- tests/utils/test_utils_interface.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/utils/test_utils_interface.py diff --git a/tests/utils/test_utils_interface.py b/tests/utils/test_utils_interface.py new file mode 100644 index 0000000..60a068f --- /dev/null +++ b/tests/utils/test_utils_interface.py @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: 2024 SECO Mind Srl +# +# SPDX-License-Identifier: Apache-2.0 + + +import subprocess +import os + + +def test_utils_interface_validate(): + interface = "test.astarte-platform.draft.interfaces.Install" + + interface_path = os.path.realpath( + os.path.join("tests", "realm_management", "test_interfaces", f"{interface}.json") + ) + + arg_list = [ + "astartectl", + "utils", + "interfaces", + "validate", + interface_path, + ] + + sample_data_result = subprocess.run(arg_list, capture_output=True, text=True) + + assert sample_data_result.returncode == 0