diff options
author | Alexander Kabui | 2021-09-22 01:53:45 +0300 |
---|---|---|
committer | Alexander Kabui | 2021-09-22 01:53:45 +0300 |
commit | 0f871f49e749eb625f58326adf8f80b3d3b5b932 (patch) | |
tree | e220d15f0d21f91ca6d5c2aaa990f9bcd94ed4c9 /tests/unit | |
parent | f4242f9743c7f236a00917fd187fbd603831dda1 (diff) | |
download | genenetwork3-0f871f49e749eb625f58326adf8f80b3d3b5b932.tar.gz |
add init tests for call to script
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/computations/test_wgcna.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit/computations/test_wgcna.py b/tests/unit/computations/test_wgcna.py index 9a88515..fd90732 100644 --- a/tests/unit/computations/test_wgcna.py +++ b/tests/unit/computations/test_wgcna.py @@ -1,12 +1,27 @@ """module contains python code for wgcna""" +from unittest import skip from unittest import TestCase +from unittest import mock + from gn3.computations.wgcna import dump_wgcna_data from gn3.computations.wgcna import compose_wgcna_cmd +from gn3.computations.wgcna import call_wgcna_script class TestWgcna(TestCase): """test class for wgcna""" + @mock.patch("gn3.computations.wgcna.dump_wgcna_data") + def test_call_wgcna_script(self, mock_dump): + """call wgcna script""" + + mock_dump.return_value = "/tmp/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc-test.json" + + results = call_wgcna_script( + "/home/kabui/project/genenetwork3/scripts/wgcna_analysis.R", {}) + + self.assertEqual(results, "dsedf") + def test_compose_wgcna_cmd(self): """test for composing wgcna cmd""" wgcna_cmd = compose_wgcna_cmd( @@ -14,6 +29,7 @@ class TestWgcna(TestCase): self.assertEqual( wgcna_cmd, "Rscript /wgcna.r /tmp/wgcna.json") + @skip("to update tests") def test_create_json_file(self): """test for writing the data to a csv file""" # # All the traits we have data for (should not contain duplicates) |