-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(data_handling.request): add test support
- Loading branch information
1 parent
9324872
commit bd0f62e
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Tests for the scripts.data_handling.request submodule. | ||
These unit tests are designed to test that genes are passed to the query correctly. | ||
They do not test the API, | ||
as tests of data returned by realworld API queries are best left to integrations tests. | ||
""" | ||
|
||
import pandas as pd | ||
|
||
from scripts.data_handling.request import lut_check | ||
|
||
lut = pd.DataFrame.from_dict({"name": ["abc", "def"], "id": ["a1", "a2"]}) | ||
|
||
|
||
def test_return_none() -> None: | ||
"""It returns None when the gene is not found.""" | ||
result = lut_check("ghi", lut) | ||
assert result is None | ||
|
||
|
||
def test_return_str() -> None: | ||
"""It returns the id when the gene is found.""" | ||
result = lut_check("abc", lut) | ||
assert result == "a1" |