Skip to content

Commit

Permalink
adds tests for the elcid.constants data/methods
Browse files Browse the repository at this point in the history
  • Loading branch information
fredkingham committed Oct 18, 2018
1 parent 0f7024a commit d367fb7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions elcid/test/test_constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from opal.core.test import OpalTestCase
from elcid import constants


class ConstantsTestCase(OpalTestCase):
def test_expected_constants(self):
"""
We won't test everything, but spot check a simple one
"""
self.assertEqual(
constants.LAB_TEST_TAGS["TITANIUM"],
['ALL-TESTS', 'ALLERGY-TESTS', 'OTHER', 'SPECIALITY-ALLERGY']
)

def test_invert_lookups(self):
# we test against an iterator as that's what
# we use in the file
to_invert = dict(a=(i for i in ["b", "c", "d"]))
expected = dict(
b=["a"],
c=["a"],
d=["a"],
)
self.assertEqual(
constants.invert_lookups(to_invert), expected
)

0 comments on commit d367fb7

Please sign in to comment.