def test_derived_irregular(self): Espanol_Dictionary.load() verb = Espanol_Dictionary.get("mantener") conjugations = verb.conjugate_irregular_tenses() print(conjugations) verb = Espanol_Dictionary.get("tener") conjugations = verb.conjugate_irregular_tenses() print(conjugations)
def test_correct_accent_derived_ends_in(self): """ despedirse - derived from despedir which is derived from pedir """ verb = Espanol_Dictionary.get("obtener") conjugation = verb.conjugate(Tense.imperative_positive, Person.second_person_singular, returnAsString=True) self.assertEqual(conjugation, "obtén") verb = Espanol_Dictionary.get("deshacer") conjugation = verb.conjugate(Tense.imperative_positive, Person.second_person_singular, returnAsString=True) self.assertEqual(conjugation, "deshaz")
def test_derived_twice_reflexive_second_person_plural(self): """ despedirse - derived from despedir which is derived from pedir """ verb = Espanol_Dictionary.get("despedirse") conjugation = verb.conjugate(Tense.imperative_positive, Person.second_person_plural, returnAsString=True) self.assertEqual(conjugation, "despedíos")
def test_derived_twice_reflexive(self): """ despedirse - derived from despedir which is derived from pedir """ verb = Espanol_Dictionary.get("despedirse") conjugation = verb.conjugate(Tense.incomplete_past_tense, Person.first_person_singular, returnAsString=True) self.assertEqual(conjugation, "me despedía")
# -*- coding: utf-8 -*- import unittest from conjugate_spanish import Tense, Person from conjugate_spanish.espanol_dictionary import Espanol_Dictionary, Verb_Dictionary Espanol_Dictionary.load() class TestEstar(unittest.TestCase): def __check__(self, tense, expected): estar = Verb_Dictionary.get("estar") for person, expected in expected.items(): self.assertEqual(expected,estar.conjugate(tense, person, returnAsString=True)) def test_estar_present_tense(self): expected = { Person.first_person_singular: "estoy", Person.second_person_singular:"estás", Person.third_person_singular:"está", Person.first_person_plural:"estamos", Person.second_person_plural:"estáis", Person.third_person_plural:"están"} self.__check__(Tense.present_tense, expected) def test_estar_incomplete_past_tense(self): expected = { Person.first_person_singular: "estaba", Person.second_person_singular:"estabas", Person.third_person_singular:"estaba", Person.first_person_plural:"estábamos", Person.second_person_plural:"estabais", Person.third_person_plural:"estaban"} self.__check__(Tense.incomplete_past_tense, expected)
def test_ser(self): verb = Espanol_Dictionary.get("ser") conjugation = verb.conjugate(Tense.present_tense, Person.first_person_singular, returnAsString=True) self.assertEqual(conjugation, "soy")