From 60d6bb05a0f928ba051fa868282d447c0f1fa060 Mon Sep 17 00:00:00 2001
From: Dilawar Singh <dilawar@subcom.tech>
Date: Fri, 7 Oct 2022 16:09:43 +0530
Subject: [PATCH] feat: Added a cli test

---
 tests/test_cli.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 tests/test_cli.py

diff --git a/tests/test_cli.py b/tests/test_cli.py
new file mode 100644
index 0000000..30ab3b4
--- /dev/null
+++ b/tests/test_cli.py
@@ -0,0 +1,18 @@
+import sys
+import subprocess
+
+
+def run_command(cmd: str, args: str):
+    cmd = f"{sys.executable} -m bitia {cmd} {args}"
+    print(f"Executing `{cmd}`")
+    return subprocess.check_output(cmd)
+
+
+def test_cli_sanity():
+    output = run_command("run", '"ls -ltr /"')
+    print(output.decode().rstrip())
+    assert len(output) > 20, "Too little output"
+
+
+if __name__ == "__main__":
+    test_cli_sanity()
-- 
GitLab