Exemple #1
0
 def test_simple_bold(self):
     text = '*hello*'
     _equals(get_text_parts(text), (('hello', 'bold'), ))
Exemple #2
0
 def test_link_with_data_both_sides(self):
     text = 'hello\n\n\nhttp://www.google.com world!\n'
     _equals(get_text_parts(text),
             (('hello\n\n\n', 'normal'), ('http://www.google.com', 'link'),
              (' world!\n', 'normal')))
Exemple #3
0
 def test_multiple_links(self):
     text = 'hello http://www.google.com world!\n other http://my.com'
     _equals(get_text_parts(text),
             (('hello ', 'normal'), ('http://www.google.com', 'link'),
              (' world!\n other ', 'normal'), ('http://my.com', 'link')))
Exemple #4
0
 def test_basic_link(self):
     text = 'http://www.google.com'
     _equals(get_text_parts(text), ((text, 'link'), ))
Exemple #5
0
 def test_basic_file(self):
     text = 'file://my/file'
     _equals(get_text_parts(text), ((text, 'link'), ))
Exemple #6
0
 def test_file_name_with_underscores(self):
     text = 'some data and then path that should not be converted My_file_name and some more text.\n'
     _equals(get_text_parts(text), ((text, 'normal'), ))
 def test_basic_link(self):
     text = 'http://www.google.com'
     _equals(get_text_parts(text), ((text, 'link'),))
 def test_two_italics(self):
     text = 'some _hello_ other _bold_\n'
     _equals(get_text_parts(text), (('some', 'normal'), (' hello ', 'italic'),
                               ('other', 'normal'), (' bold\n', 'italic')))
 def test_file_name_with_underscores(self):
     text = 'some data and then path that should not be converted My_file_name and some more text.\n'
     _equals(get_text_parts(text), ((text, 'normal'), ))
 def test_simple_bold(self):
     text = '*hello*'
     _equals(get_text_parts(text), (('hello', 'bold'), ))
 def test_two_bolds(self):
     text = 'some *hello* other *bold*\n'
     _equals(get_text_parts(text), (('some', 'normal'), (' hello ', 'bold'),
                               ('other', 'normal'), (' bold\n', 'bold')))
 def test_multiple_links(self):
     text = 'hello http://www.google.com world!\n other http://my.com'
     _equals(get_text_parts(text), (('hello ', 'normal'),
                               ('http://www.google.com', 'link'),
                               (' world!\n other ', 'normal'),
                               ('http://my.com', 'link')))
 def test_link_with_data_both_sides(self):
     text = 'hello\n\n\nhttp://www.google.com world!\n'
     _equals(get_text_parts(text), (('hello\n\n\n', 'normal'),
                               ('http://www.google.com', 'link'),
                               (' world!\n', 'normal')))
 def test_basic_file(self):
     text = 'file://my/file'
     _equals(get_text_parts(text), ((text, 'link'),))
Exemple #15
0
 def test_two_bolds(self):
     text = 'some *hello* other *bold*\n'
     _equals(get_text_parts(text),
             (('some', 'normal'), (' hello ', 'bold'), ('other', 'normal'),
              (' bold\n', 'bold')))
 def test_performance(self):
     starttime = time.time()
     _equals(get_text_parts(long_message), ((long_message, 'normal'), ))
     self.assertTrue(time.time() - starttime < 2)
Exemple #17
0
 def test_two_italics(self):
     text = 'some _hello_ other _bold_\n'
     _equals(get_text_parts(text),
             (('some', 'normal'), (' hello ', 'italic'),
              ('other', 'normal'), (' bold\n', 'italic')))
Exemple #18
0
 def test_basic(self):
     text = 'hello'
     _equals(get_text_parts(text), ((text, 'normal'), ))
Exemple #19
0
 def test_performance(self):
     starttime = time.time()
     _equals(get_text_parts(long_message), ((long_message, 'normal'), ))
     self.assertTrue(time.time() - starttime < 2)
 def test_basic(self):
     text = 'hello'
     _equals(get_text_parts(text), ((text, 'normal'),))