Skip to content

Commit

Permalink
Add test for validating trigger configuration
Browse files Browse the repository at this point in the history
 - Add test to validate Astarte triggers using astartectl

Signed-off-by: Jusuf <[email protected]>
  • Loading branch information
Jusuf95 committed Dec 10, 2024
1 parent 57fbfac commit c8880d9
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/utils/test_utils_triggers_validate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# SPDX-FileCopyrightText: 2024 SECO Mind Srl
#
# SPDX-License-Identifier: Apache-2.0


import subprocess
import os


def test_utils_triggers_validate():

trigger = "test_trigger"
trigger_path = os.path.realpath(
os.path.join("tests", "realm_management", "test_triggers", f"{trigger}.json")
)

arg_list = [
"astartectl",
"utils",
"triggers",
"validate",
trigger_path,
]
trigger_result = subprocess.run(arg_list, capture_output=True, text=True)

assert trigger_result.returncode == 0

0 comments on commit c8880d9

Please sign in to comment.