diff options
author | Alexanderkabui | 2020-12-14 22:36:36 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-01-06 01:29:02 +0300 |
commit | 868b8cba1cda983d8d401e60e30794529b557c80 (patch) | |
tree | a527d2b695fca4a5005d4c0871cbf2d7cd424ee7 /wqflask/tests/unit | |
parent | 2030cc56db878b05e5507c7c3d5ddef39ff223cb (diff) | |
download | genenetwork2-868b8cba1cda983d8d401e60e30794529b557c80.tar.gz |
modify get_header tests
Diffstat (limited to 'wqflask/tests/unit')
-rw-r--r-- | wqflask/tests/unit/wqflask/snp_browser/test_snp_browser.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/wqflask/tests/unit/wqflask/snp_browser/test_snp_browser.py b/wqflask/tests/unit/wqflask/snp_browser/test_snp_browser.py index e8751778..9ec32c78 100644 --- a/wqflask/tests/unit/wqflask/snp_browser/test_snp_browser.py +++ b/wqflask/tests/unit/wqflask/snp_browser/test_snp_browser.py @@ -15,6 +15,18 @@ class TestSnpBrowser(unittest.TestCase): def tearDown(self): self.app_context.pop() + def test_get_header_list(self): + empty_columns={"snp_source":"false","conservation_score":"true","gene_name":"false","transcript":"false","exon":"false","domain_2":"true","function":"false","function_details":"true"} + strains={"mouse":["S1","S2","S3","S4","S5"],"rat":[]} + expected_results=([['Index', 'SNP ID', 'Chr', 'Mb', 'Alleles', 'ConScore', 'Domain 1', 'Domain 2', 'Details'], ['S1', 'S2', 'S3', 'S4', 'S5']], 5) + + results_with_snp=get_header_list(variant_type="SNP",strains=strains,species="Mouse",empty_columns=empty_columns) + results_with_indel=get_header_list(variant_type="InDel",strains=strains,species="rat",empty_columns=[]) + expected_results_with_indel=(['Index', 'ID', 'Type', 'InDel Chr', 'Mb Start', 'Mb End', 'Strand', 'Size', 'Sequence', 'Source'],0) + + self.assertEqual(expected_results,results_with_snp) + self.assertEqual(results_with_indel,expected_results_with_indel) + @mock.patch("wqflask.snp_browser.snp_browser.g") def test_get_gene_id(self, mock_db): @@ -56,17 +68,6 @@ class TestSnpBrowser(unittest.TestCase): results=get_browser_sample_lists(species_id="12") self.assertEqual(results, {'mouse': [], 'rat': []}) - def test_get_header_list(self): - empty_columns={"snp_source":"false","conservation_score":"true","gene_name":"false","transcript":"false","exon":"false","domain_2":"true","function":"false","function_details":"true"} - strains={"mouse":["S1","S2","S3","S4","S5"],"rat":[]} - expected_results=([['Index', 'SNP ID', 'Chr', 'Mb', 'Alleles', 'ConScore', 'Domain 1', 'Domain 2', 'Details'], ['S1', 'S2', 'S3', 'S4', 'S5']], 5) - - results_with_snp=get_header_list(variant_type="SNP",strains=strains,species="Mouse",empty_columns=empty_columns) - results_with_indel=get_header_list(variant_type="InDel",strains=strains,species="rat",empty_columns=[]) - expected_results_with_indel=(['Index', 'ID', 'Type', 'InDel Chr', 'Mb Start', 'Mb End', 'Strand', 'Size', 'Sequence', 'Source'],0) - - self.assertEqual(expected_results,results_with_snp) - self.assertEqual(results_with_indel,expected_results_with_indel) |