From 3260b880c0003b7d55bd026b9f1d259256648b0e Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 12 Aug 2020 12:27:34 -0700 Subject: transform: more string cleaning --- tests/test_scrub.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_scrub.py b/tests/test_scrub.py index 6541e13..b142c10 100644 --- a/tests/test_scrub.py +++ b/tests/test_scrub.py @@ -1,4 +1,4 @@ -from fatcat_scholar.schema import scrub_text +from fatcat_scholar.schema import scrub_text, clean_str def test_scrub() -> None: @@ -12,3 +12,21 @@ def test_scrub() -> None: for raw, fixed in vectors: assert fixed == scrub_text(raw) + + +def test_clean_str() -> None: + vectors = [ + ( + "Di� Hekimli�i Fak�ltesi ��rencilerinde Temporomandibular Eklem Rahats�zl�klar�n�n ve A��z Sa�l��� Al��kanl�klar�n�n De�erlendirilmesi", + "Di� Hekimli�i Fak�ltesi ��rencilerinde Temporomandibular Eklem Rahats�zl�klar�n�n ve A��z Sa�l��� Al��kanl�klar�n�n De�erlendirilmesi", + ), + ("blah thing", "blah thing"), + ("title with italics", "title with italics"), + ("title with partial super", "title with partial super"), + ("", None), + ("&NA", None), + (None, None), + ] + + for raw, fixed in vectors: + assert fixed == clean_str(raw) -- cgit v1.2.3