#!/usr/bin/python3
"""Run the telegram-send command and check output is as expected."""

import subprocess
import sys

expected_output = "Config not found\nPlease run: telegram-send --configure\n"
command = ["telegram-send"]

try:
    result = subprocess.run(command, check=True, capture_output=True, text=True)
except subprocess.CalledProcessError as e:
    if e.output == expected_output:
        print("Test passed.")
        sys.exit(0)
    else:
        print("Test failed: Unexpected output.")
        sys.exit(1)

print("Test failed: Command did not fail as expected.")
sys.exit(1)
