コード例 #1
0
 def test_double_replace(self):
     self.assertEquals(
         emoticons('some text :oops:', ''),
         'some text <img src="/embarrassment.gif" alt=":oops:" />')
コード例 #2
0
 def format_text(self, text):
     if not isinstance(text, str):
         text = str(text, 'utf-8')
     text = emoticons(replace_links(cgi.escape(text, 1)),
                      self.emoticons_directory)
     return text.replace('\n', '<br />')
コード例 #3
0
 def test_imagedir(self):
     self.assertEquals('<img src="/foo/happy.gif" alt=": )" />',
                       emoticons(':)', '/foo'))
     self.assertEquals('<img src="/foo/happy.gif" alt=": )" />',
                       emoticons(':)', '/foo/'))
コード例 #4
0
 def test_some_chars(self):
     self.assertEquals('):-,<:', emoticons('):-,<:', ''))
コード例 #5
0
 def test_double_smiley(self):
     self.assertEquals(
         '<img src="/happy.gif" alt=": )" />'
         '<img src="/wink.gif" alt="; )" />', emoticons(':-);)', ''))
コード例 #6
0
 def test_simple_smiley(self):
     self.assertEquals('<img src="/happy.gif" alt=": )" />',
                       emoticons(':)', ''))
コード例 #7
0
 def test_no_emoticons(self):
     self.assertEquals('foo', emoticons('foo', ''))
     self.assertEquals('foo(bar:b)az-)', emoticons('foo(bar:b)az-)', ''))