From bf66744db3a667659e503b7b4470d3ae2c1429a1 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Wed, 8 Jul 2020 11:02:56 -0400 Subject: [PATCH] remove round from `fuzz.token_sort_ratio(str1, str2)` call --- stix2/environment.py | 2 +- stix2/test/v21/test_environment.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stix2/environment.py b/stix2/environment.py index 24cfd79..0a6bdb2 100644 --- a/stix2/environment.py +++ b/stix2/environment.py @@ -365,7 +365,7 @@ def partial_string_based(str1, str2): """ from rapidfuzz import fuzz - result = round(fuzz.token_sort_ratio(str1, str2)) + result = fuzz.token_sort_ratio(str1, str2) logger.debug("--\t\tpartial_string_based '%s' '%s'\tresult: '%s'", str1, str2, result) return result / 100.0 diff --git a/stix2/test/v21/test_environment.py b/stix2/test/v21/test_environment.py index fd4798f..7a7d4c1 100644 --- a/stix2/test/v21/test_environment.py +++ b/stix2/test/v21/test_environment.py @@ -787,7 +787,7 @@ def test_semantic_equivalence_prop_scores(): tool2 = stix2.v21.Tool(id=TOOL_ID, **TOOL2_KWARGS) stix2.Environment().semantically_equivalent(tool1, tool2, prop_scores) assert len(prop_scores) == 4 - assert round(prop_scores["matching_score"], 1) == 8.8 + assert round(prop_scores["matching_score"], 1) == 8.9 assert round(prop_scores["sum_weights"], 1) == 100.0