From a6bce64dfcce5eb9017c8dafc0d97935ec2b3ebf Mon Sep 17 00:00:00 2001
From: Dilawar Singh <dilawar@subcom.tech>
Date: Fri, 7 Oct 2022 16:46:38 +0530
Subject: [PATCH] chore (ci): Use the module

---
 tests/test_cli.py | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/tests/test_cli.py b/tests/test_cli.py
index 89ffb9b..fe4885e 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1,21 +1,9 @@
-import sys
-import shlex
-from pathlib import Path
-import subprocess
-
-
-def run_command(cmd: str, args: str):
-    cmd = f"{sys.executable} -m bitia {cmd} {args}"
-    print(f"Executing `{shlex.split(cmd)}`")
-    assert Path(sys.executable).is_file()
-    p = subprocess.run(shlex.split(cmd), capture_output=True)
-    return p.stdout
+from bitia.__main__ import run_pipeline
 
 
 def test_cli_sanity():
-    output = run_command("run", '"ls -ltr /"')
-    print(output.decode().rstrip())
-    assert len(output) > 20, "Too little output"
+    for line in run_pipeline("ls -ltr /"):
+        print(line)
 
 
 if __name__ == "__main__":
-- 
GitLab