Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-writer committed Feb 24, 2020
1 parent 57365f2 commit 85bf736
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions tests/test_quotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,30 @@ def test_requote_no_change(text: str):


@pytest.mark.parametrize(
"before_after", list(zip(smart_quotes, change_words_not_quotes, requoted))
"before_after_correct", list(zip(smart_quotes, change_words_not_quotes, requoted))
)
def test_text_change_but_same_quote_count(before_after: Tuple[str, str, str]):
before, after, correct = before_after
def test_text_change_but_same_quote_count(before_after_correct: Tuple[str, str, str]):
before, after, correct = before_after_correct
q = Quotes(before)
assert q.requote_modified_string(after) == correct


changed_quote_cases = [
(
"Yeah , he’d’ve done something “intelligent”",
'Yeah , he\'s done something "intelligent"',
"Yeah , he’s done something “intelligent”",
),
(
"There are many storeʼs like that one , which Iʼm a fan of",
"There are many stores like that one , which I'm a fan of",
"There are many stores like that one , which Iʼm a fan of",
),
]


@pytest.mark.parametrize("before_after_correct", changed_quote_cases)
def test_change_quote_count(before_after_correct: Tuple[str, str, str]):
before, after, correct = before_after_correct
q = Quotes(before)
assert q.requote_modified_string(after) == correct

0 comments on commit 85bf736

Please sign in to comment.