Ejemplo n.º 1
0
 def test_longer_than(self):
     self.assertEqual(
         ['interesting', 'understatement'],
         word_processor.words_longer_than(
             10,
             'These are indeed interesting, an obvious understatement, times. What say you?'
         ))
Ejemplo n.º 2
0
    def test_longer_than(self):
        
        output = StringIO()
        sys.stdout = output

        words_longer = word_processor.words_longer_than(10,'These are indeed interesting, an obvious understatement, times. What say you?')
        self.assertEqual(['interesting','understatement'],words_longer)
 def test_words_longer_than(self):
     """
         This function makes sure that it only returns a list of words in the text that is longer than 10
     """
     words = word_processor.words_longer_than(
         10,
         'These are indeed interesting, an obvious understatement, times. What say you?'
     )
     self.assertEqual(['interesting', 'understatement'], words)
Ejemplo n.º 4
0
 def test_step2_filter_words_2(self):
     words = word_processor.words_longer_than(
         100,
         'These are indeed interesting, an obvious understatement, times. What say you?'
     )
     self.assertEqual([], words)
Ejemplo n.º 5
0
 def test_word_longer_than(self):
     text = "these are indeed interesting an obvious understatement times what say you"
     result = ['interesting', 'understatement']
     self.assertEqual(word_processor.words_longer_than(10, text), result)
Ejemplo n.º 6
0
 def test_words_longer_than(self):
     results = word_processor.words_longer_than(
         4, 'Hello; How, you doing? Its been long.')
     self.assertEqual(['hello', 'doing'], results)
Ejemplo n.º 7
0
 def test_words_longer_than(self):
     words = "These are indeed interesting, an obvious understatement, times. What say you?"
     self.assertTrue(word_processor.words_longer_than(4, "words"), True)
Ejemplo n.º 8
0
 def test_words_longer_than(self):
     result= word_processor.words_longer_than(7 ,'These are indeed interesting, an obvious understatement, times. What say you?')
     self.assertTrue(result, "['interesting', 'understatement']")
Ejemplo n.º 9
0
 def test_words_longer_than_str(self):
     self.assertEqual(words_longer_than(4, 123), -1)
Ejemplo n.º 10
0
 def test_words_longer_than_digit(self):
     self.assertEqual(words_longer_than("", "nickelback -Here And Now"), -1)
Ejemplo n.º 11
0
 def test_words_longer_than(self):
     self.assertEqual(words_longer_than(5, "nickelback -Here And Now"),
                      ['nickelback'])
 def test_return_words_over_length(self):
     """tests that the word_longer_than function returns words that are longer than the given length"""
     result = word_processor.words_longer_than(
         6, "once a lifetime twice a day")
     expect = ['lifetime']
     self.assertEqual(expect, result)
Ejemplo n.º 13
0
 def test_words_longer_than(self):
     result = word_processor.words_longer_than(7, '')
     self.assertTrue(result, "['interesting', 'understatement']")
Ejemplo n.º 14
0
    def test_words_longer_than(self):
        number = word_processor.words_longer_than(5,text)
        self.assertEqual(number,['Facing', 'greatest', 'marshmallow'])

        number = word_processor.words_longer_than(0,text)
        self.assertEqual(number, ['Facing', 'his', 'greatest', 'fear', 'he', 'ate','his', 'first', 'marshmallow'])
Ejemplo n.º 15
0
 def test_words_longer_than_digit(self):
     self.assertEqual(words_longer_than(12, ""), [])
Ejemplo n.º 16
0
 def test_filter_words(self):
     results = word_processor.words_longer_than(10,'These are indeed interesting, an obvious understatement, times. What say you?')
     expected = ['interesting', 'understatement']
     self.assertEqual(results,expected)
Ejemplo n.º 17
0
 def test_step2(self):
     self.assertEqual(
         word_processor.words_longer_than(4, "Hello my name is TRON"),
         ["hello"])