コード例 #1
0
def test_get_ts_queries_from_keywords_string_with_coma_parses_keywords_string_ignoring_words_with_less_than_one_char(
):
    # given
    keywords_string = "Læetitia a mangé's'"

    # when
    keywords_result = _get_ts_queries_from_keywords_string(keywords_string)

    # then
    assert keywords_result == ["læetitia:*", "mangé:*"]
コード例 #2
0
def test_get_ts_queries_from_keywords_url_parses_keywords_string_ignoring_ou_with_accent(
):
    # given
    keywords_string = "yolo bonjour où va"

    # when
    keywords_result = _get_ts_queries_from_keywords_string(keywords_string)

    # then
    assert keywords_result == ["yolo:*", "bonjour:*", "va:*"]
コード例 #3
0
def test_get_ts_queries_from_keywords_url_parses_keywords_string_ignoring_special_chars(
):
    # given
    keywords_string = "http://www.test.com"

    # when
    keywords_result = _get_ts_queries_from_keywords_string(keywords_string)

    # then
    assert keywords_result == ["http:*", "www:*", "test:*", "com:*"]
コード例 #4
0
def test_get_ts_queries_from_keywords_string_with_double_space_parses_keywords_string_ignoring_stop_words_with_capital_letter(
):
    # given
    keywords_string = "Un lit sous une rivière"

    # when
    keywords_result = _get_ts_queries_from_keywords_string(keywords_string)

    # then
    assert keywords_result == ["lit:*", "sous:*", "rivière:*"]
コード例 #5
0
def test_get_ts_queries_from_keywords_string_parses_keywords_string_into_list_of_ts_strings(
):
    # given
    keywords_string = "PNL chante Marx"

    # when
    keywords_result = _get_ts_queries_from_keywords_string(keywords_string)

    # then
    assert keywords_result == ["pnl:*", "chante:*", "marx:*"]
コード例 #6
0
def test_get_ts_queries_from_keywords_string_with_double_space_parses_keywords_string_ignoring_stop_words(
):
    # given
    keywords_string = "PNL  chante avec Marx"

    # when
    keywords_result = _get_ts_queries_from_keywords_string(keywords_string)

    # then
    assert keywords_result == ["pnl:*", "chante:*", "marx:*"]