Exemplo n.º 1
0
 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."
     )
Exemplo n.º 2
0
 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."
     )
Exemplo n.º 3
0
 def test_sentences(self):
     sentence = "booyakasha!"
     s = Translate.capitalize(self.translate, sentence)
     self.assertEqual(s, "Booyakasha!")
Exemplo n.º 4
0
 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.")
Exemplo n.º 5
0
 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")
Exemplo n.º 6
0
 def test_possesive(self):
     sentence = "My my"
     s = Translate.kraang(self.translate, sentence)
     self.assertEqual(s, u"Kraang's Kraang's")
Exemplo n.º 7
0
 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.")
Exemplo n.º 8
0
 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.")
Exemplo n.º 9
0
 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")
Exemplo n.º 10
0
 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.")
Exemplo n.º 11
0
 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.")
Exemplo n.º 12
0
 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.")
Exemplo n.º 13
0
 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.")
Exemplo n.º 14
0
 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.")
Exemplo n.º 15
0
 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.")
Exemplo n.º 16
0
 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!"))
Exemplo n.º 17
0
 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.")
Exemplo n.º 18
0
 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.")
Exemplo n.º 19
0
 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.")
Exemplo n.º 20
0
 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.")
Exemplo n.º 21
0
 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.")
Exemplo n.º 22
0
 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.")
Exemplo n.º 23
0
 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.")
Exemplo n.º 24
0
 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.")
Exemplo n.º 25
0
 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.")