Skip to content

Commit fd8ab0f

Browse files
committed
add a smiple tests
1 parent 05b9fc8 commit fd8ab0f

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

tests/smoke_test.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import subprocess
2+
import sys
3+
4+
def main():
5+
try:
6+
# Run the installed script with --help
7+
result = subprocess.run(["safe-view", "--help"], capture_output=True, text=True, check=True)
8+
print("safe-view --help output:")
9+
print(result.stdout)
10+
if "usage: safe-view" not in result.stdout:
11+
print("Error: 'usage: safe-view' not found in help output.")
12+
sys.exit(1)
13+
print("Smoke test passed!")
14+
except FileNotFoundError:
15+
print("Error: 'safe-view' command not found. Is the package installed correctly?")
16+
sys.exit(1)
17+
except subprocess.CalledProcessError as e:
18+
print(f"Error running 'safe-view --help': {e}")
19+
print(f"Stderr: {e.stderr}")
20+
sys.exit(1)
21+
22+
if __name__ == "__main__":
23+
main()

0 commit comments

Comments
 (0)