Example #1
0
def test_given_invalid_text_when_parsed_then_return_empty_list(
        text: str, expected_result: str):
    # given, when
    actual_result = gather_duplicates(text)

    # then
    assert expected_result == actual_result, \
        f"Expected: {expected_result}, Actual: {actual_result}"
Example #2
0
def test_given_a_text_with_duplicates_when_parsed_then_return_the_duplicates():
    # given
    expected_results = {'.': 2, 'hardworking': 3, 'people': 2}

    # when
    actual_results = gather_duplicates(text_with_duplicates)

    # then
    assert expected_results == actual_results, \
        "Should have found multiple duplicates in the text"
Example #3
0
def test_given_a_text_with_no_duplicates_when_parsed_then_return_empty():
    # given
    expected_results = {}

    # when
    actual_results = gather_duplicates(text_with_a_number)

    # then
    assert expected_results == actual_results, \
        "Should have NOT found duplicates in the text"