예제 #1
0
    def test_text_decreasing_line(self):
        test_str = """
a b c d e
a b c d
a b c
a b
a
    """
        self.assertEqual(unique_prefixes.process_text(test_str), ['a'])
예제 #2
0
    def test_text_new_lines_gaps(self):
        test_str = """


Osheaga Music and Arts Festival Saturday AAA


Osheaga Music and Arts Festival Saturday BBB

Osheaga Music and Arts Festival Saturday CCC

Osheaga Music and Arts Festival Sunday AAA

Osheaga Music and Arts Festival Sunday BBB

Osheaga Music and Arts Festival Sunday CCC

            
        """
        print(unique_prefixes.process_text(test_str))
        self.assertEqual(unique_prefixes.process_text(test_str),
                         ['Osheaga Music and Arts Festival'])
예제 #3
0
 def test_text_original(self):
     self.assertEqual(unique_prefixes.process_text(
         self.test_str_original), [
             'Lollapalooza', 'Osheaga Music and Arts Festival',
             'The Meadows Music and Arts Festival', 'WayHome Music Festival'
         ])
예제 #4
0
 def test_text_two_same_line(self):
     line = 'Christmas'
     self.assertEqual(unique_prefixes.process_text(line + "\n" + line),
                      [line])
예제 #5
0
 def test_text_one_line(self):
     self.assertEqual(unique_prefixes.process_text('Christmas Festival'),
                      [])
예제 #6
0
 def test_text_no_inpit(self):
     self.assertEqual(unique_prefixes.process_text(''), [])