-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds tests for the elcid.constants data/methods
- Loading branch information
1 parent
0f7024a
commit d367fb7
Showing
1 changed file
with
26 additions
and
0 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
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 | ||
) |