Ejemplo n.º 1
0
def test_clear_case_forms_functions_as_advertised():
    word = Word(u"dzień", "m inan")
    word.set_case_forms(
        "singular", {"nominative": "dzień", "instrumental": "dniem"})
    word.set_case_forms("plural", {"nominative": "dni", "locative": "dniach"})
    assert word.get_case_form("singular", "nominative") == "dzień"
    assert word.get_case_form("plural", "nominative") == "dni"
    assert word.get_case_form("plural", "locative") == "dniach"
    word.clear_case_forms()
    assert not word.supports("singular", "nominative")
    assert not word.supports("plural", "nominative")
    assert not word.supports("plural", "locative")
Ejemplo n.º 2
0
def test_set_case_forms_overwrites_all_for_specific_number():
    word = Word(u"dzień", "m inan")
    word.set_case_forms(
        "singular", {"nominative": "dzień", "instrumental": "dniem"})
    word.set_case_forms("plural", {"nominative": "dni", "locative": "dniach"})
    # Overwrite the values for singular
    word.set_case_forms(
        "singular", {"nominative": "something", "vocative": "else"})
    assert not word.supports("singular", "instrumental")
    assert word.get_case_form("singular", "nominative") == "something"
    assert word.get_case_form("singular", "vocative") == "else"
    assert word.get_case_form("plural", "nominative") == "dni"
    assert word.get_case_form("plural", "locative") == "dniach"
Ejemplo n.º 3
0
def test_supports_method_correctly_identifies_available_case_forms():
    word = Word(u"dzień", "m inan")
    word.set_case_forms("singular", {"nominative": "dzień"})
    assert word.supports("singular", "accusative") is False
    assert word.supports("plural", "nominative") is False
    assert word.supports("singular", "nominative") is True
Ejemplo n.º 4
0
def test_supports_method_works_with_unset_case_forms():
    word = Word(u"dzień", "m inan")
    assert word.supports("singular", "accusative") is False