Skip to content

Commit

Permalink
Trim tests
Browse files Browse the repository at this point in the history
  • Loading branch information
caufieldjh committed Jan 4, 2024
1 parent 31444e0 commit 93ca623
Show file tree
Hide file tree
Showing 75 changed files with 1 addition and 76,485 deletions.
84 changes: 1 addition & 83 deletions tests/integration/test_cli/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""Tests the command-line interface."""
import unittest

import inflection
from click.testing import CliRunner

import tests.integration.test_knowledge_engines.test_cases as extract_cases
from talisman.cli import main
from tests import CASES_DIR, OUTPUT_DIR
from tests import OUTPUT_DIR
from tests.integration.test_knowledge_engines.test_enrichment import PEX

CACHE_DB = str(OUTPUT_DIR / "cli_cache.db")
Expand All @@ -27,86 +25,6 @@ def test_main_help(self):
self.assertIn("halo", out)
self.assertEqual(0, result.exit_code)

def test_extract(self):
for case in extract_cases.CASES:
template, input_name = case
input_file = str(CASES_DIR / f"{input_name}.txt")
fmts = ["yaml", "html", "md"]
if template == "recipe":
fmts.append("owl")
for fmt in fmts:
output_file = str(CLI_OUTPUT_DIR / f"{input_name}.{fmt}")
cmd = [
"--cache-db",
CACHE_DB,
"extract",
"-t",
template,
input_file,
"-O",
fmt,
"-o",
output_file,
]
print(cmd)
result = self.runner.invoke(main, cmd)
self.assertEqual(0, result.exit_code)
out = result.stdout
print(out)

def test_pubmed_extract(self):
cases = [
("PMID:32044947", "treatment.DiseaseTreatmentSummary"),
]
for pmid, template in cases:
for fmt in ["yaml", "html"]:
output_file = str(CLI_OUTPUT_DIR / f"pmid-{pmid}-{template}.{fmt}")
cmd = [
"--cache-db",
CACHE_DB,
"pubmed-extract",
"-t",
template,
pmid,
"-O",
fmt,
"-o",
output_file,
]
print(cmd)
result = self.runner.invoke(main, cmd)
self.assertEqual(0, result.exit_code)
out = result.stdout
print(out)

def test_search_and_extract(self):
cases = [
("treatment.DiseaseTreatmentSummary", "COVID-19", ["review"]),
]
for template, term, keywords in cases:
for fmt in ["yaml", "html"]:
safe_term = inflection.underscore(term)
output_file = str(CLI_OUTPUT_DIR / f"{template}-search-{safe_term}.{fmt}")
cmd = [
"--cache-db",
CACHE_DB,
"search-and-extract",
"-t",
template,
term,
"-O",
fmt,
"-o",
output_file,
]
for kw in keywords:
cmd.extend(["-k", kw])
print(cmd)
result = self.runner.invoke(main, cmd)
self.assertEqual(0, result.exit_code)
out = result.stdout
print(out)

def test_enrichment(self):
ids = [id for id, _ in PEX]
cmd = ["enrichment"] + ids
Expand Down
Empty file.
222 changes: 0 additions & 222 deletions tests/integration/test_clients/test_openai_client.py

This file was deleted.

33 changes: 0 additions & 33 deletions tests/integration/test_clients/test_pubmed_client.py

This file was deleted.

Loading

0 comments on commit 93ca623

Please sign in to comment.