예제 #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."
     )
예제 #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."
     )
예제 #3
0
 def test_sentences(self):
     sentence = "booyakasha!"
     s = Translate.capitalize(self.translate, sentence)
     self.assertEqual(s, "Booyakasha!")
예제 #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.")
예제 #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")
예제 #6
0
 def test_possesive(self):
     sentence = "My my"
     s = Translate.kraang(self.translate, sentence)
     self.assertEqual(s, u"Kraang's Kraang's")
예제 #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.")
예제 #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.")
예제 #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")
예제 #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.")
예제 #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.")
예제 #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.")
예제 #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.")
예제 #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.")
예제 #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.")
예제 #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!"))
예제 #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.")
예제 #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.")
예제 #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.")
예제 #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.")
예제 #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.")
예제 #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.")
예제 #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.")
예제 #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.")
예제 #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.")