Skip to content

Commit

Permalink
feat: Add new field to response
Browse files Browse the repository at this point in the history
  • Loading branch information
gromdimon committed Oct 16, 2023
1 parent 9ff8a62 commit a303599
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import typing
from unittest.mock import Mock

import hgvs.exceptions
from _pytest.monkeypatch import MonkeyPatch
from fastapi.testclient import TestClient
from pytest_snapshot.plugin import Snapshot
Expand Down Expand Up @@ -148,6 +149,22 @@ def test_to_spdi_g_38(test_client: TestClient, monkeypatch: MonkeyPatch):
assert response.json() == expected


def test_to_spdi_invalid(test_client: TestClient, monkeypatch: MonkeyPatch):
mock_driver = Mock()
mock_driver.parser = Mock()
mock_driver.parser.parse = Mock()
mock_driver.parser.parse.side_effect = hgvs.exceptions.HGVSParseError
monkeypatch.setattr(dotty_main, "driver", mock_driver)

response = test_client.get("/api/v1/to-spdi?q=BRCA1")
assert response.status_code == 200
expected = {
"success": False,
"value": None,
}
assert response.json() == expected


def test_find_transcripts_grch37(
test_client: TestClient, monkeypatch: MonkeyPatch, snapshot: Snapshot
):
Expand Down

0 comments on commit a303599

Please sign in to comment.