-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove unsued code and add tests
- Loading branch information
Showing
4 changed files
with
710 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,40 @@ | ||
(ns aidbox-sdk.converter-test | ||
(:require | ||
[clojure.test :refer [deftest is]] | ||
[clojure.test :refer [deftest is are testing]] | ||
[aidbox-sdk.fixtures.schemas :as fixtures] | ||
[aidbox-sdk.converter :as sut])) | ||
|
||
(deftest test-converter-utils | ||
(testing "url->resource-name" | ||
(are [x y] (= x y) | ||
"date" | ||
(sut/url->resource-name "http://hl7.org/fhir/StructureDefinition/date") | ||
|
||
(deftest resolve-reference-test | ||
"ContactDetail" | ||
(sut/url->resource-name "http://hl7.org/fhir/StructureDefinition/ContactDetail") | ||
|
||
"Immunization" | ||
(sut/url->resource-name "http://hl7.org/fhir/StructureDefinition/Immunization") | ||
|
||
"openEHR-exposureDate" | ||
(sut/url->resource-name "http://hl7.org/fhir/StructureDefinition/openEHR-exposureDate") | ||
|
||
"iso21090-ADXP-deliveryAddressLine" | ||
(sut/url->resource-name "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryAddressLine")))) | ||
|
||
(deftest test-resolve-references | ||
(is (= (sut/resolve-references fixtures/schemas-with-element-reference) | ||
fixtures/schemas-with-element-reference-resolved))) | ||
|
||
(deftest test-backbones-flattening | ||
(is (= (sut/flatten-backbones fixtures/unflattened-backbone-elements []) | ||
fixtures/flattened-backbone-elements))) | ||
|
||
(deftest test-convert | ||
(testing "convert resource" | ||
(is (= (sut/convert [fixtures/patient-fhir-schema]) | ||
[fixtures/patient-ir-schema]))) | ||
|
||
(testing "convert constraint" | ||
(is (= (sut/convert [fixtures/organization-preferred-contact-fhir-schema]) | ||
[fixtures/organization-preferred-contact-ir-schema])))) |
Oops, something went wrong.