"""Tests para remove_words_from_column."""

import sys
import os

sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))

from remove_words_from_column import remove_words_from_column


def test_elimina_palabras_case_insensitive():
    values = ["Calle Mayor 14", "Avenida del Sol"]
    result = remove_words_from_column(values, words=["calle", "avenida", "del"])
    assert result == ["Mayor 14", "Sol"]


def test_none_devuelve_string_vacio():
    result = remove_words_from_column([None, "hola mundo"], words=["hola"])
    assert result[0] == ""
    assert result[1] == "mundo"


def test_colapsa_espacios_multiples():
    result = remove_words_from_column(["uno dos tres"], words=["dos"])
    assert result[0] == "uno tres"


def test_palabras_vacias_no_modifica():
    values = ["hola mundo", "foo bar"]
    result = remove_words_from_column(values, words=[])
    assert result == ["hola mundo", "foo bar"]


def test_palabra_completa_no_parcial():
    # "calle" no debe eliminar "calleja"
    result = remove_words_from_column(["calleja mayor"], words=["calle"])
    assert result[0] == "calleja mayor"


def test_lista_vacia():
    result = remove_words_from_column([], words=["foo"])
    assert result == []
