From f646930550462241d79b0e09b04941c189b1b9ec Mon Sep 17 00:00:00 2001 From: Mark Wardle Date: Sat, 7 Dec 2024 07:53:24 +0000 Subject: [PATCH] Improve importer tests --- src/com/eldrix/hermes/importer.clj | 11 ++++ ...2_Description_Snapshot-en_INT_20230131.txt | 2 + test/src/com/eldrix/hermes/importer_test.clj | 62 ++++++------------- 3 files changed, 32 insertions(+), 43 deletions(-) diff --git a/src/com/eldrix/hermes/importer.clj b/src/com/eldrix/hermes/importer.clj index 366dbf0..c21cec6 100644 --- a/src/com/eldrix/hermes/importer.clj +++ b/src/com/eldrix/hermes/importer.clj @@ -136,6 +136,17 @@ (log/debug "Processing cancelled (output channel closed)") (throw (InterruptedException. "process cancelled"))))))))) +(defn import-file + "Import a SNOMED file, returning a map containing :type :headings :parser + and :data as per [[process-file]]. This is designed only for testing and + development purposes." + [f] + (let [ch (a/chan)] + (a/thread + (process-file f ch) + (a/close! ch)) + (a/