From 09f699253400a807e2390e6515b204a1b9f4c3a9 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 13 May 2021 11:16:32 +0300 Subject: tests: test_general: Add test case for run_r_qtl endpoint --- tests/integration/test_general.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/integration/test_general.py b/tests/integration/test_general.py index 99c4824..8fc2b43 100644 --- a/tests/integration/test_general.py +++ b/tests/integration/test_general.py @@ -46,3 +46,14 @@ class GeneralAPITest(unittest.TestCase): self.assertEqual(response.get_json(), {"status": 128, "error": "gzip failed to unpack file"}) + + @mock.patch("gn3.api.general.run_cmd") + def test_run_r_qtl(self, mock_run_cmd): + """Test correct upload of file""" + mock_run_cmd.return_value = "Random results from STDOUT" + response = self.app.post("/api/qtl/run/" + "geno_file_test/" + "pheno_file_test") + self.assertEqual(response.status_code, 201) + self.assertEqual(response.get_json(), + "Random results from STDOUT") -- cgit v1.2.3