diff options
author | Alexander_Kabui | 2024-09-03 12:31:04 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-09-03 12:31:04 +0300 |
commit | a190f6aa0ddd745e46f6ca059d06a3fca5ffbf2e (patch) | |
tree | a91bf74b10a2b9d6a8c195bda8aba032ca571143 /tests/unit | |
parent | 3c3f91e6cfd0f4557101dfb0729d0b4f6bad3604 (diff) | |
download | genenetwork3-a190f6aa0ddd745e46f6ca059d06a3fca5ffbf2e.tar.gz |
Make pylint fixes.
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/test_llm.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/unit/test_llm.py b/tests/unit/test_llm.py index 51b4921..8fbaba6 100644 --- a/tests/unit/test_llm.py +++ b/tests/unit/test_llm.py @@ -1,4 +1,5 @@ """Test cases for procedures defined in llms """ +# pylint: disable=C0301 import pytest from gn3.llms.process import fetch_pubmed from gn3.llms.process import parse_context @@ -36,6 +37,7 @@ def test_parse_context(): @pytest.mark.unit_test def test_format_bib_info(): + """Test for formatting bibliography info """ mock_fahamu_bib_info = [ { "author": "J.m", @@ -52,17 +54,17 @@ def test_format_bib_info(): "2015 - Differential regional and cellular distribution of TFF3 peptide in the human brain" ] - assert all([format_bibliography_info(data) == expected + assert all((format_bibliography_info(data) == expected for data, expected - in zip(mock_fahamu_bib_info, expected_result)]) + in zip(mock_fahamu_bib_info, expected_result))) @pytest.mark.unit_test def test_fetching_pubmed_info(monkeypatch): - - def mock_load_file(filename, dir_path): + """Test for fetching and populating pubmed data with pubmed info""" + def mock_load_file(_filename, _dir_path): return { - "12121" : { + "12121": { "Abstract": "items1", "Author": "A1" } @@ -83,22 +85,22 @@ def test_fetching_pubmed_info(monkeypatch): }, { "title": "Aging", - "year" : "2014", + "year": "2014", "doc_id": "12122" } ] - data = [ { + data = [{ "title": "Genes", "year": "2014", "doi": "https/article/genes/12121", "doc_id": "12121", - }, - { + }, + { "title": "Aging", - "year" : "2014", + "year": "2014", "doc_id": "12122" - }] + }] assert (fetch_pubmed(data, "/pubmed.json", "data/") == expected_results) |