def test_null(self): """ testing null """ with self.assertRaises(Exception) as context: englishtofrench(None) self.assertTrue('ApiException' in context.exception)
def test_empty(self): self.assertEqual(englishtofrench(""), "")
def test_null(self): self.assertEqual(englishtofrench(None), "")
def test_sentence2(self): self.assertEqual(englishtofrench("How old are you?"), "Quel âge as-tu?")
def test_sentence1(self): self.assertEqual(englishtofrench("Hello everyone"), "Bonjour tout le monde")
def test_englishtofrench(self): '''Tests for french translation''' self.assertIsNone(None, "No input provided") self.assertEqual(englishtofrench("Hello"), "Bonjour") self.assertEqual(englishtofrench("How are you"), "Comment vous êtes") self.assertEqual(englishtofrench("Goodbye"), "Au revoir")
def test_other(self): """ testing nice to meet you with French """ self.assertEqual(englishtofrench("nice to meet you"), "Gentiez de vous rencontrer")
def test_hello(self): """ testing hello with French """ self.assertEqual(englishtofrench("hello"), "Bonjour")
def test_englishtofrench(self): self.assertEqual(englishtofrench(""), "Input is empty") self.assertEqual(englishtofrench("Hello"), "Bonjour") self.assertNotEqual(englishtofrench("Hey"), "Bonjour")
def test1(self): self.assertEqual(englishtofrench("hello"),"Bonjour") self.assertEqual(englishtofrench("welcome"),"Bienvenue") self.assertEqual(englishtofrench("love"),"Amour")