-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
41 additions
and
9 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import unittest | ||
from mtbp3.health.ectd import ctoc_by_fda | ||
|
||
class TestCtocByFDA(unittest.TestCase): | ||
|
||
def setUp(self): | ||
self.ctoc = ctoc_by_fda(ectd_version="3.2.2", ctoc_version="2.3.3") | ||
|
||
def test_load_list(self): | ||
self.assertIsInstance(self.ctoc.ctoc, list) | ||
self.assertGreater(len(self.ctoc.ctoc), 0) | ||
|
||
def test_show_ctoc_tree(self): | ||
tree = self.ctoc.show_ctoc_tree(module=1, to_right=False) | ||
self.assertIsInstance(tree[0], str) | ||
self.assertGreater(len(tree), 0) | ||
|
||
def test_find_section_given_words(self): | ||
result = self.ctoc.find_section_given_words("REMS", outfmt='simple', include='up', to_right=False) | ||
self.assertIsInstance(result, list) | ||
self.assertGreater(len(result), 0) | ||
|
||
def test_find_section_given_words_invalid_include(self): | ||
with self.assertRaises(ValueError): | ||
self.ctoc.find_section_given_words("REMS", outfmt='simple', include='invalid', to_right=False) | ||
|
||
def test_find_section_given_words_invalid_outfmt(self): | ||
with self.assertRaises(ValueError): | ||
self.ctoc.find_section_given_words("REMS", outfmt='invalid', include='up', to_right=False) | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |
File renamed without changes.