Skip to content

Commit

Permalink
feat: add more distances tests++
Browse files Browse the repository at this point in the history
  • Loading branch information
BenTenmann committed Dec 10, 2021
1 parent 9bf6215 commit 400049d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/test_distances.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ def _method():
return _method


@pytest.fixture()
def tcr_dist_keys():
return ['cdr_1', 'cdr_2', 'cdr_2_5', 'cdr_3']


@pytest.fixture()
def tcr_dist_base():
def _method():
Expand Down Expand Up @@ -158,8 +163,11 @@ def test_tcr_dist_component(tcr_dist_component, sequences, distances):


@pytest.mark.parametrize(['sequences', 'distances'], convert_to_tcr_dist_format(test_cases, tcr_dist_results))
def test_tcr_dist(tcr_dist_base, sequences, distances):
def test_tcr_dist(tcr_dist_base, tcr_dist_keys, sequences, distances):
metric = tcr_dist_base()
assert metric.required_input_keys == tcr_dist_keys
assert all(k == key for (k, _), key in zip(metric.default_definition, tcr_dist_keys))

response = metric(sequences)

n = len(sequences)
Expand All @@ -178,8 +186,10 @@ def test_tcr_dist_error(tcr_dist_base, sequences, distances):


@pytest.mark.parametrize(['sequences', 'distances'], convert_to_tcr_dist_format(test_cases, tcr_dist_results))
def test_tcr_dist_custom(tcr_dist_custom, sequences, distances):
def test_tcr_dist_custom(tcr_dist_custom, tcr_dist_keys, sequences, distances):
metric = tcr_dist_custom()
assert metric.required_input_keys == tcr_dist_keys

response = metric(sequences)

n = len(sequences)
Expand Down

0 comments on commit 400049d

Please sign in to comment.