diff options
| author | Frederick Muriuki Muriithi | 2025-02-28 12:44:55 -0600 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2025-02-28 12:44:55 -0600 |
| commit | ef1436bca390ee916b7119036ab2d3de8d1344fb (patch) | |
| tree | 8ed0197669d51d2f825080bfbda10e35fa2403aa /tests | |
| parent | 4edc4450e6fe578212600ad9733f0fa6eb3ffc9f (diff) | |
| download | genenetwork3-ef1436bca390ee916b7119036ab2d3de8d1344fb.tar.gz | |
Fix linting errors.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/fixtures/rdf.py | 7 | ||||
| -rw-r--r-- | tests/integration/test_gemma.py | 66 | ||||
| -rw-r--r-- | tests/unit/db/test_gen_menu.py | 4 |
3 files changed, 37 insertions, 40 deletions
diff --git a/tests/fixtures/rdf.py b/tests/fixtures/rdf.py index 98c4058..0811d3c 100644 --- a/tests/fixtures/rdf.py +++ b/tests/fixtures/rdf.py @@ -59,7 +59,8 @@ def rdf_setup(): # Make sure this graph does not exist before running anything requests.delete( - SPARQL_CONF["sparql_crud_auth_uri"], params=params, auth=auth + SPARQL_CONF["sparql_crud_auth_uri"], params=params, auth=auth, + timeout=300 ) # Open the file in binary mode and send the request @@ -69,9 +70,11 @@ def rdf_setup(): params=params, auth=auth, data=file, + timeout=300 ) yield response requests.delete( - SPARQL_CONF["sparql_crud_auth_uri"], params=params, auth=auth + SPARQL_CONF["sparql_crud_auth_uri"], params=params, auth=auth, + timeout=300 ) pid.terminate() diff --git a/tests/integration/test_gemma.py b/tests/integration/test_gemma.py index 53a1596..7bc1df9 100644 --- a/tests/integration/test_gemma.py +++ b/tests/integration/test_gemma.py @@ -63,10 +63,9 @@ class GemmaAPITest(unittest.TestCase): @mock.patch("gn3.api.gemma.assert_paths_exist") @mock.patch("gn3.api.gemma.redis.Redis") @mock.patch("gn3.api.gemma.cache_ipfs_file") - def test_k_compute(self, mock_ipfs_cache, - mock_redis, - mock_path_exist, mock_json, mock_hash, - mock_queue_cmd): + def test_k_compute(# pylint: disable=[too-many-positional-arguments] + self, mock_ipfs_cache, mock_redis, mock_path_exist, mock_json, + mock_hash, mock_queue_cmd): """Test /gemma/k-compute/<token>""" mock_ipfs_cache.return_value = ("/tmp/cache/" "QmQPeNsJPyVWPFDVHb" @@ -106,9 +105,9 @@ class GemmaAPITest(unittest.TestCase): @mock.patch("gn3.api.gemma.assert_paths_exist") @mock.patch("gn3.api.gemma.redis.Redis") @mock.patch("gn3.api.gemma.cache_ipfs_file") - def test_k_compute_loco(self, mock_ipfs_cache, - mock_redis, mock_path_exist, mock_json, - mock_hash, mock_queue_cmd): + def test_k_compute_loco(# pylint: disable=[too-many-positional-arguments] + self, mock_ipfs_cache, mock_redis, mock_path_exist, mock_json, + mock_hash, mock_queue_cmd): """Test /gemma/k-compute/loco/<chromosomes>/<token>""" mock_ipfs_cache.return_value = ("/tmp/cache/" "QmQPeNsJPyVWPFDVHb" @@ -150,9 +149,9 @@ class GemmaAPITest(unittest.TestCase): @mock.patch("gn3.api.gemma.assert_paths_exist") @mock.patch("gn3.api.gemma.redis.Redis") @mock.patch("gn3.api.gemma.cache_ipfs_file") - def test_gwa_compute(self, mock_ipfs_cache, - mock_redis, mock_path_exist, mock_json, - mock_hash, mock_queue_cmd): + def test_gwa_compute(# pylint: disable=[too-many-positional-arguments] + self, mock_ipfs_cache, mock_redis, mock_path_exist, mock_json, + mock_hash, mock_queue_cmd): """Test /gemma/gwa-compute/<k-inputfile>/<token>""" mock_ipfs_cache.return_value = ("/tmp/cache/" "QmQPeNsJPyVWPFDVHb" @@ -201,9 +200,9 @@ class GemmaAPITest(unittest.TestCase): @mock.patch("gn3.api.gemma.assert_paths_exist") @mock.patch("gn3.api.gemma.redis.Redis") @mock.patch("gn3.api.gemma.cache_ipfs_file") - def test_gwa_compute_with_covars(self, mock_ipfs_cache, - mock_redis, mock_path_exist, - mock_json, mock_hash, mock_queue_cmd): + def test_gwa_compute_with_covars(# pylint: disable=[too-many-positional-arguments] + self, mock_ipfs_cache, mock_redis, mock_path_exist, mock_json, + mock_hash, mock_queue_cmd): """Test /gemma/gwa-compute/covars/<k-inputfile>/<token>""" mock_ipfs_cache.return_value = ("/tmp/cache/" "QmQPeNsJPyVWPFDVHb" @@ -255,9 +254,9 @@ class GemmaAPITest(unittest.TestCase): @mock.patch("gn3.api.gemma.assert_paths_exist") @mock.patch("gn3.api.gemma.redis.Redis") @mock.patch("gn3.api.gemma.cache_ipfs_file") - def test_gwa_compute_with_loco_only(self, mock_ipfs_cache, - mock_redis, mock_path_exist, - mock_json, mock_hash, mock_queue_cmd): + def test_gwa_compute_with_loco_only(# pylint: disable=[too-many-positional-arguments] + self, mock_ipfs_cache, mock_redis, mock_path_exist, mock_json, + mock_hash, mock_queue_cmd): """Test /gemma/gwa-compute/<k-inputfile>/loco/maf/<maf>/<token> """ @@ -308,10 +307,9 @@ class GemmaAPITest(unittest.TestCase): @mock.patch("gn3.api.gemma.assert_paths_exist") @mock.patch("gn3.api.gemma.redis.Redis") @mock.patch("gn3.api.gemma.cache_ipfs_file") - def test_gwa_compute_with_loco_covars(self, mock_ipfs_cache, - mock_redis, mock_path_exist, - mock_json, mock_hash, - mock_queue_cmd): + def test_gwa_compute_with_loco_covars(# pylint: disable=[too-many-positional-arguments] + self, mock_ipfs_cache, mock_redis, mock_path_exist, mock_json, + mock_hash, mock_queue_cmd): """Test /gemma/gwa-compute/<k-inputfile>/loco/covars/maf/<maf>/<token> """ @@ -363,10 +361,9 @@ class GemmaAPITest(unittest.TestCase): @mock.patch("gn3.api.gemma.assert_paths_exist") @mock.patch("gn3.api.gemma.redis.Redis") @mock.patch("gn3.api.gemma.cache_ipfs_file") - def test_k_gwa_compute_without_loco_covars(self, mock_ipfs_cache, - mock_redis, - mock_path_exist, mock_json, - mock_hash, mock_queue_cmd): + def test_k_gwa_compute_without_loco_covars(# pylint: disable=[too-many-positional-arguments] + self, mock_ipfs_cache, mock_redis, mock_path_exist, mock_json, + mock_hash, mock_queue_cmd): """Test /gemma/k-gwa-compute/<token> """ @@ -419,10 +416,9 @@ class GemmaAPITest(unittest.TestCase): @mock.patch("gn3.api.gemma.assert_paths_exist") @mock.patch("gn3.api.gemma.redis.Redis") @mock.patch("gn3.api.gemma.cache_ipfs_file") - def test_k_gwa_compute_with_covars_only(self, mock_ipfs_cache, - mock_redis, mock_path_exist, - mock_json, mock_hash, - mock_queue_cmd): + def test_k_gwa_compute_with_covars_only(# pylint: disable=[too-many-positional-arguments] + self, mock_ipfs_cache, mock_redis, mock_path_exist, mock_json, + mock_hash, mock_queue_cmd): """Test /gemma/k-gwa-compute/covars/<token> """ @@ -484,10 +480,9 @@ class GemmaAPITest(unittest.TestCase): @mock.patch("gn3.api.gemma.assert_paths_exist") @mock.patch("gn3.api.gemma.redis.Redis") @mock.patch("gn3.api.gemma.cache_ipfs_file") - def test_k_gwa_compute_with_loco_only(self, mock_ipfs_cache, - mock_redis, mock_path_exist, - mock_json, mock_hash, - mock_queue_cmd): + def test_k_gwa_compute_with_loco_only(# pylint: disable=[too-many-positional-arguments] + self, mock_ipfs_cache, mock_redis, mock_path_exist, mock_json, + mock_hash, mock_queue_cmd): """Test /gemma/k-gwa-compute/loco/<chromosomes>/maf/<maf>/<token> """ @@ -550,10 +545,9 @@ class GemmaAPITest(unittest.TestCase): @mock.patch("gn3.api.gemma.assert_paths_exist") @mock.patch("gn3.api.gemma.redis.Redis") @mock.patch("gn3.api.gemma.cache_ipfs_file") - def test_k_gwa_compute_with_loco_and_covar(self, mock_ipfs_cache, - mock_redis, - mock_path_exist, mock_json, - mock_hash, mock_queue_cmd): + def test_k_gwa_compute_with_loco_and_covar(# pylint: disable=[too-many-positional-arguments] + self, mock_ipfs_cache, mock_redis, mock_path_exist, mock_json, + mock_hash, mock_queue_cmd): """Test /k-gwa-compute/covars/loco/<chromosomes>/maf/<maf>/<token> """ diff --git a/tests/unit/db/test_gen_menu.py b/tests/unit/db/test_gen_menu.py index e6b5711..f64b4d3 100644 --- a/tests/unit/db/test_gen_menu.py +++ b/tests/unit/db/test_gen_menu.py @@ -120,7 +120,7 @@ class TestGenMenu(unittest.TestCase): with db_mock.cursor() as conn: with conn.cursor() as cursor: for item in ["x", ("result"), ["result"], [1]]: - cursor.fetchone.return_value = (item) + cursor.fetchone.return_value = item self.assertTrue(phenotypes_exist(db_mock, "test")) @pytest.mark.unit_test @@ -140,7 +140,7 @@ class TestGenMenu(unittest.TestCase): db_mock = mock.MagicMock() with db_mock.cursor() as cursor: for item in ["x", ("result"), ["result"], [1]]: - cursor.fetchone.return_value = (item) + cursor.fetchone.return_value = item self.assertTrue(phenotypes_exist(db_mock, "test")) @pytest.mark.unit_test |
