def test_plural(self): random.seed(0) sentence = "Turtles fight the Foot Clan soldiers." s = Translate.kraang(self.translate, sentence) self.assertEqual( s, u"The things which are named Turtles fight " "the things which are named Foot Clan soldiers." )
def test_lots_of_punctuation(self): sentence = ( "this is the test string! will it work? let's find out. it should work! or should it? oh yes. indeed." ) s = Translate.capitalize(self.translate, sentence) self.assertEqual( s, "This is the test string! Will it work? Let's find out. It should work! Or should it? Oh yes. Indeed." )
def test_sentences(self): sentence = "booyakasha!" s = Translate.capitalize(self.translate, sentence) self.assertEqual(s, "Booyakasha!")
def test_proper_noun_sentence(self): sentence = "let's skateboard in the Dojo with Mikey." s = Translate.capitalize(self.translate, sentence) self.assertEqual(s, "Let's skateboard in the Dojo with Mikey.")
def test_reflective(self): sentence = "I We we Us us Our our" s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"Kraang Kraang Kraang Kraang Kraang Kraang Kraang")
def test_possesive(self): sentence = "My my" s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"Kraang's Kraang's")
def test_single_quote(self, random_call): sentence = "The Turtle's pizza was getting cold." random_call.return_value = "<kraang> " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"The <kraang> Turtle's pizza was getting cold.")
def test_double_nouns(self, random_call): sentence = "Splinter saw a space mutant." random_call.return_value = "<kraang> " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"<kraang> Splinter saw a <kraang> space mutant.")
def test_no_period(self, random_call): sentence = "Donnie creates Metalhead" random_call.return_value = "<kraang> " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"<kraang> Donnie creates <kraang> Metalhead")
def test_tricky_period_sentence(self): sentence = "mikey went to St. Louis." s = Translate.capitalize(self.translate, sentence) self.assertEqual(s, "Mikey went to St. Louis.")
def test_replace_an2(self, random_call): sentence = "Russian soldiers approached the Turtles." random_call.return_value = "the things known as " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"Russian soldiers approached " "the things known as Turtles.")
def test_replace_a(self, random_call): sentence = "A Foot Clan soldier approached Raphael." random_call.return_value = "the thing known as " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"The thing known as Foot Clan soldier approached " "the thing known as Raphael.")
def test_replace_an(self, random_call): sentence = "An attacker approached Leo." random_call.return_value = "the thing known as " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"The thing known as attacker approached " "the thing known as Leo.")
def test_that_replace_the(self, random_call): sentence = "Mikey yells at Shredder." random_call.return_value = "that which is known as " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"That which is known as Mikey yells at that " "which is known as Shredder.")
def test_double_thes(self, random_call): sentence = "The Turtles fight Shredder's clan." random_call.return_value = "the things known as " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"The things known as Turtles fight the things " "known as Shredder's clan.")
def test_multiple_proper_noun_sentences(self): sentence = "let's skateboard in the Dojo with Mikey. we'll flip out " "Donny!" s = Translate.capitalize(self.translate, sentence) self.assertEqual(s, ("Let's skateboard in the Dojo with Mikey. We'll " "flip out Donny!"))
def test_adding_the(self, random_call): sentence = "Donny likes April." random_call.return_value = "<kraang> " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"<kraang> Donny likes <kraang> April.")
def test_truncate_extra_spaces(self): sentence = " let's skateboard in the Dojo with Mikey. " s = Translate.capitalize(self.translate, sentence) self.assertEqual(s, "Let's skateboard in the Dojo with Mikey.")
def test_to_place(self, random_call): sentence = "The Turtles went to the Dojo." random_call.return_value = "<kraang> " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"The <kraang> Turtles went to that place. " "To the <kraang> Dojo.")
def test_i_am(self): sentence = "I am hot. We are very hot." s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"Kraang is hot. Kraang is very hot.")
def test_apostrophes(self, random_call): sentence = "Splinter isn't going to take a nap." random_call.return_value = "<kraang> " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"<kraang> Splinter isn't going to take a " "<kraang> nap.")
def test_starting_with_the(self, random_call): sentence = "The pizza was stolen by Mikey." random_call.return_value = "<kraang> " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"The <kraang> pizza was stolen by <kraang> " "Mikey.")
def test_i(self, random_call): sentence = "I will destroy Turtles and we will win." random_call.return_value = "<kraang> " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"Kraang will destroy <kraang> Turtles and Kraang will win.")
def test_to_followed_by_verb(self, random_call): sentence = "The Turtles went to play above ground." random_call.return_value = "<kraang> " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"The <kraang> Turtles went to play above " "<kraang> ground.")
def test_double_plural_nouns(self, random_call): sentence = "Splinter saw Snoop Dogg." random_call.return_value = "<kraang> " s = Translate.kraang(self.translate, sentence) self.assertEqual(s, u"<kraang> Splinter saw <kraang> Snoop Dogg.")