diff options
| author | Frederick Muriuki Muriithi | 2025-10-22 13:27:54 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2025-10-22 13:27:54 -0500 |
| commit | 05013c13710eccadb69746bf186eb672c2af69c4 (patch) | |
| tree | 71a706fd30bf0d535a0fab737bb0e42a1667e60b /tests | |
| parent | 977efbb54da284fb3e8476f200206d00cb8e64cd (diff) | |
| download | genenetwork3-05013c13710eccadb69746bf186eb672c2af69c4.tar.gz | |
Fetch configs from app setting and pass them down
Fix the code to avoid using global variables holding configuration variables to avoid the failures caused by action-at-a-distance effects due to change of a value elsewhere. This way, all code consistently receives the same configuration values passed on from callers. We pass on the following configuration settings: * TMPDIR * SQL_URI * TEXTDIR
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/integration/test_partial_correlations.py | 2 | ||||
| -rw-r--r-- | tests/unit/computations/test_wgcna.py | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/tests/integration/test_partial_correlations.py b/tests/integration/test_partial_correlations.py index fc9f64f..56af260 100644 --- a/tests/integration/test_partial_correlations.py +++ b/tests/integration/test_partial_correlations.py @@ -221,4 +221,4 @@ def test_part_corr_api_with_mix_of_existing_and_non_existing_control_traits( criteria = 10 with pytest.warns(UserWarning): partial_correlations_with_target_db( - db_conn, primary, controls, method, criteria, target) + db_conn, primary, controls, method, criteria, target, "/tmp") diff --git a/tests/unit/computations/test_wgcna.py b/tests/unit/computations/test_wgcna.py index 55432af..acba10e 100644 --- a/tests/unit/computations/test_wgcna.py +++ b/tests/unit/computations/test_wgcna.py @@ -85,9 +85,9 @@ class TestWgcna(TestCase): mock_img.return_value = b"AFDSFNBSDGJJHH" results = call_wgcna_script( - "Rscript/GUIX_PATH/scripts/r_file.R", request_data) + "Rscript/GUIX_PATH/scripts/r_file.R", request_data, "/tmp") - mock_dumping_data.assert_called_once_with(request_data) + mock_dumping_data.assert_called_once_with(request_data, "/tmp") mock_compose_wgcna.assert_called_once_with( "Rscript/GUIX_PATH/scripts/r_file.R", @@ -119,7 +119,7 @@ class TestWgcna(TestCase): mock_run_cmd.return_value = expected_error self.assertEqual(call_wgcna_script( - "input_file.R", ""), expected_error) + "input_file.R", "", "/tmp"), expected_error) @pytest.mark.skip( "This test assumes that the system will always be invoked from the root" @@ -166,8 +166,7 @@ class TestWgcna(TestCase): file_name_generator.return_value = "facb73ff-7eef-4053-b6ea-e91d3a22a00c" - results = dump_wgcna_data( - expected_input) + results = dump_wgcna_data(expected_input, "/tmp") file_handler.assert_called_once_with( "/tmp/facb73ff-7eef-4053-b6ea-e91d3a22a00c.json", 'w', encoding='utf-8') |
