diff generate_test.py @ 3:95b4196b4ded draft

planemo upload for repository https://github.com/brsynth/galaxytools commit 5e85823d729e9e09adf66ccfb7c47701077dccff-dirty
author tduigou
date Mon, 15 Sep 2025 12:59:58 +0000
parents 6d20407d9a72
children 815748762646
line wrap: on
line diff
--- a/generate_test.py	Mon Sep 15 09:42:19 2025 +0000
+++ b/generate_test.py	Mon Sep 15 12:59:58 2025 +0000
@@ -22,7 +22,13 @@
 
         print("Cmd:", " ".join(cmd))
         ret = subprocess.run(cmd)
-        assert ret.returncode == 0
+        if ret.returncode != 0:
+            msg = f"Command failed: {' '.join(cmd)}\n"
+            if ret.stdout:
+                msg += "Stdout:", ret.stdout + "\n"
+            if ret.stderr:
+                msg += "Stderr:", ret.stderr + "\n"
+            raise Exception()
 
         return compute_md5(path=fd.name)
 
@@ -30,66 +36,41 @@
 if __name__ == "__main__":
 
     print("=" * 50)
-    print("EC number")
-    ec_number = "1.1.1.1"
-    cmd = ["--input-ec-number-str", ec_number]
-    value = run_cmd(subcommand="ec-number", sub_cmd=cmd)
-    print("Test:", " ".join(cmd), "md5:", value)
-    cmd = ["--input-ec-number-str", ec_number, "--input-min-diameter-int", "16"]
-    value = run_cmd(subcommand="ec-number", sub_cmd=cmd)
-    print("Test:", " ".join(cmd), "md5:", value)
-
-    print("=" * 50)
-    print("Substrate")
-    substrate = "pyruvate"
-    cmd = ["--input-substrate-str", substrate]
-    value = run_cmd(subcommand="substrate", sub_cmd=cmd)
-    print("Test:", " ".join(cmd), "md5:", value)
-    cmd = ["--input-substrate-str", substrate, "--input-min-diameter-int", "16"]
-    value = run_cmd(subcommand="substrate", sub_cmd=cmd)
-    print("Test:", " ".join(cmd), "md5:", value)
-
-    print("=" * 50)
-    print("Reaction id")
-    reaction_id = "MNXR104443"
-    repository = "mnx"
-    cmd = ["--input-reaction-id-str", reaction_id, "--input-repository-str", repository]
-    value = run_cmd(subcommand="reaction-id", sub_cmd=cmd)
-    print("Test:", " ".join(cmd), "md5:", value)
-    cmd.extend(["--input-min-diameter-int", "1"])
-    value = run_cmd(subcommand="reaction-id", sub_cmd=cmd)
+    print("templates")
+    smarts_str = "[O]-[C](=[O])"
+    cmd = ["--input-smarts-str", smarts_str, "--input-limit-int", "5"]
+    value = run_cmd(subcommand="templates", sub_cmd=cmd)
     print("Test:", " ".join(cmd), "md5:", value)
 
     print("=" * 50)
-    print("Inchi")
-    inchi = "InChI=1S/C4H4O5/c5-2(4(8)9)1-3(6)7/h1H2,(H,6,7)(H,8,9)/p-2"
-    cmd = ["--input-inchi-str", inchi]
-    value = run_cmd(subcommand="inchi", sub_cmd=cmd)
+
+    print("templates-summary")
+    template_id = "RR:03-27BC85-19184A-A71018"
+    cmd = ["--input-template-id-str", template_id]
+    value = run_cmd(subcommand="templates-summary", sub_cmd=cmd)
     print("Test:", " ".join(cmd), "md5:", value)
-    cmd.extend(["--input-min-diameter-int", "1"])
-    value = run_cmd(subcommand="inchi", sub_cmd=cmd)
+    
+    print("=" * 50)
+
+    print("templates-sources")
+    template_id = "RR:03-27BC85-19184A-A71018"
+    cmd = ["--input-template-id-str", template_id]
+    value = run_cmd(subcommand="templates-sources", sub_cmd=cmd)
+    print("Test:", " ".join(cmd), "md5:", value)
+    
+    print("=" * 50)
+    
+    print("templates-count")
+    smarts_str = "[O]-[C](=[O])"
+    cmd = ["--input-smarts-str", smarts_str]
+    value = run_cmd(subcommand="templates-count", sub_cmd=cmd)
     print("Test:", " ".join(cmd), "md5:", value)
 
     print("=" * 50)
-    print("Repository")
-    repository = "kegg"
-    cmd = ["--input-repository-str", repository]
-    value = run_cmd(subcommand="repository", sub_cmd=cmd)
-    print("Test:", " ".join(cmd), "md5:", value)
-    cmd.extend(["--input-min-diameter-int", "16"])
-    value = run_cmd(subcommand="repository", sub_cmd=cmd)
+    """
+    print("templates-export")
+    smarts_str = "[O]-[C](=[O])"
+    cmd = ["--input-smarts-str", smarts_str]
+    value = run_cmd(subcommand="templates-export", sub_cmd=cmd)
     print("Test:", " ".join(cmd), "md5:", value)
-
-    print("=" * 50)
-    print("Smarts id")
-    smarts_id = "RR00239878"
-    cmd = ["--input-smarts-id-str", smarts_id]
-    value = run_cmd(subcommand="smarts-id", sub_cmd=cmd)
-    print("Test:", " ".join(cmd), "md5:", value)
-    cmd.extend(["--input-min-diameter-int", "16"])
-    value = run_cmd(subcommand="smarts-id", sub_cmd=cmd)
-    print("Test:", " ".join(cmd), "md5:", value)
-    smarts_ids = ["RR00239877", "RR00239878"]
-    cmd = ["--input-smarts-id-str"] + smarts_ids
-    value = run_cmd(subcommand="smarts-id", sub_cmd=cmd)
-    print("Test:", " ".join(cmd), "md5:", value)
+    """
\ No newline at end of file