예제 #1
0
    def test_string(self):
        with pytest.raises(AttributeError):
            str(translate.ITranslation())

        # Add attributes manually
        translation = translate.ITranslation()
        translation.from_lang = "English"
        translation.to_lang = "Spanish"

        assert repr(translation) == "English -> Spanish"
예제 #2
0
 def test_hypotheses(self):
     with pytest.raises(NotImplementedError):
         translate.ITranslation().hypotheses("this is some text")
예제 #3
0
 def test_translate(self):
     with pytest.raises(NotImplementedError):
         translate.ITranslation().translate("some input")