@@ -0,0 +1,2124 @@
+#!/usr/bin/env python3%0A%0Aimport os%0Aimport sys%0Aimport tempfile%0Aimport unittest%0A%0Asys.path.append('../../../')%0Afrom bin.trait_mapping.create_efo_table import *%0A%0A%0Aclass TestCreateEFOTableComponents(unittest.TestCase):%0A%0A    def setUp(self):%0A        self.input_file = tempfile.NamedTemporaryFile(delete=False)%0A        self.output_file = tempfile.NamedTemporaryFile(delete=False)%0A        with open(self.input_file.name, 'w') as infile:%0A            infile.write('http://purl.obolibrary.org/obo/MONDO_0014263%5Cn'%0A                         'http://www.orpha.net/ORDO/Orphanet_505216%5Cn')%0A%0A    def tearDown(self):%0A        os.remove(self.input_file.name)%0A        os.remove(self.output_file.name)%0A%0A    def test_get_ols_details(self):%0A        %22%22%22Check that the output of the script is adequate in terms of format; also check two example traits.%22%22%22%0A        create_efo_table(self.input_file.name, self.output_file.name)%0A        with open(self.output_file.name) as outfile:%0A            out_lines = outfile.read().splitlines()%0A        self.assertEqual(len(out_lines), 2, 'Should get two output lines for two input lines')%0A        trait_1, trait_2 = %5Bout_line.split('%5Ct') for out_line in out_lines%5D%0A        for trait in %5Btrait_1, trait_2%5D:%0A            self.assertEqual(len(trait), 22, 'Each output line must contain correct number of columns')%0A%0A        # Trait 1%0A        self.assertEqual(trait_1%5B0%5D, 'Verheij syndrome')  # disease%0A        self.assertEqual(trait_1%5B1%5D, 'inherited genetic disease')  # child of%0A        self.assertEqual(trait_1%5B12%5D, 'OMIM:615583')  # OMIM cross-ref%0A        self.assertEqual(trait_1%5B15%5D, 'UMLS:C3810023')  # ULMS cross-ref%0A        self.assertEqual(trait_1%5B21%5D, 'MONDO_0014263')  # MONDO ref%0A%0A        # Trait 2%0A        self.assertEqual(trait_2%5B0%5D, '3-methylglutaconic aciduria type 9')  # disease%0A        self.assertEqual(trait_2%5B1%5D, 'disease')  # child of%0A        self.assertEqual(trait_2%5B3%5D, '3-methylglutaconic aciduria-epilepsy-spasticity-severe intellectual '%0A                                     'disability syndrome %7C%7C MGA9')  # synonyms%0A        self.assertEqual(trait_2%5B18%5D, 'Orphanet:505216')  # Orphanet ref%0A

add tests