def test_noun_word(): ans = (['The capital and largest city of France.']) assert translate("Paris") == ans
def translate(): Text_dict.delete("1.40", END) c = app1.translate(e3.get()) if type(c) == str: Text_dict.insert(END, c) e3.delete("0", END)
def test_word_nonlist(): ans = [ 'The science that deals with concepts such as quantity, structure, space and change.' ] assert translate("mathematics") == ans
def test_word_in_dict(): assert translate("rain") == ([ 'Precipitation in the form of liquid water drops with diameters greater than 0.5 millimetres.', 'To fall from the clouds in drops of water.' ])
def test_space_word(): ans = "The word doesn't exist. Please double check it." assert translate(" ") == ans
def test_word_uppercase(): ans = ([ 'Precipitation in the form of liquid water drops with diameters greater than 0.5 millimetres.', 'To fall from the clouds in drops of water.' ]) assert translate("RAIN") == ans
def test_word_not_in_dict(): ans = "The word doesn't exist. Please double check it." assert translate("dddd") == ans