From ceacf6f97ec430bc626954bcf548f7988b9d23df Mon Sep 17 00:00:00 2001
From: Tim Abbott
link: xx, x xxxxx xx xxxx xx
\nxxxxx #xx:\ @@ -2180,38 +2182,38 @@ xxxxxxx
\nxxxxxxx xxxxx xxxx xxxxx:
\nxxxxxx: xxx
def test_inline_image(self):
msg = 'Google logo today: https://www.google.com/images/srpr/logo4w.png\nKinda boring'
- converted = convert(msg)
+ converted = bugdown_convert(msg)
self.assertEqual(converted, '
Google logo today: https://www.google.com/images/srpr/logo4w.png
\nKinda boring
Google logo today: https://www.google.com/images/srpr/logo4w.png
\nKinda boringGoogle logo today: https://www.google.com/images/srpr/logo4w.png
\nKinda boring
Check out the debate: http://www.youtube.com/watch?v=hx1mjT73xYE
\n') def test_inline_dropbox(self): msg = 'Look at how hilarious our old office was: https://www.dropbox.com/s/ymdijjcg67hv2ta/IMG_0923.JPG' - converted = convert(msg) + converted = bugdown_convert(msg) self.assertEqual(converted, 'Look at how hilarious our old office was: https://www.dropbox.com/s/ymdijjcg67hv2ta/IMG_0923.JPG
\n') msg = 'Look at my hilarious drawing: https://www.dropbox.com/sh/inlugx9d25r314h/JYwv59v4Jv/credit_card_rushmore.jpg' - converted = convert(msg) + converted = bugdown_convert(msg) self.assertEqual(converted, 'Look at my hilarious drawing: https://www.dropbox.com/sh/inlugx9d25r314h/JYwv59v4Jv/credit_card_rushmore.jpg
\n') # Make sure we're not overzealous in our conversion: msg = 'Look at the new dropbox logo: https://www.dropbox.com/static/images/home_logo.png' - converted = convert(msg) + converted = bugdown_convert(msg) self.assertEqual(converted, 'Look at the new dropbox logo: https://www.dropbox.com/static/images/home_logo.png
\n') @@ -2224,45 +2226,45 @@ xxxxxxx\nxxxxxxx xxxxx xxxx xxxxx:
\nxxxxxx: xxx
return """
%s
' % make_link('http://www.twitter.com')) msg = 'http://www.twitter.com/wdaher/' - converted = convert(msg) + converted = bugdown_convert(msg) self.assertEqual(converted, '%s
' % make_link('http://www.twitter.com/wdaher/')) msg = 'http://www.twitter.com/wdaher/status/3' - converted = convert(msg) + converted = bugdown_convert(msg) self.assertEqual(converted, '%s
' % make_link('http://www.twitter.com/wdaher/status/3')) # id too long msg = 'http://www.twitter.com/wdaher/status/2879779692873154569' - converted = convert(msg) + converted = bugdown_convert(msg) self.assertEqual(converted, '%s
' % make_link('http://www.twitter.com/wdaher/status/2879779692873154569')) # id too large (i.e. tweet doesn't exist) msg = 'http://www.twitter.com/wdaher/status/999999999999999999' - converted = convert(msg) + converted = bugdown_convert(msg) self.assertEqual(converted, '%s
' % make_link('http://www.twitter.com/wdaher/status/999999999999999999')) msg = 'http://www.twitter.com/wdaher/status/287977969287315456' - converted = convert(msg) + converted = bugdown_convert(msg) self.assertEqual(converted, '%s
\n%s' % (make_link('http://www.twitter.com/wdaher/status/287977969287315456'), make_inline_twitter_preview('http://www.twitter.com/wdaher/status/287977969287315456'))) msg = 'https://www.twitter.com/wdaher/status/287977969287315456' - converted = convert(msg) + converted = bugdown_convert(msg) self.assertEqual(converted, '%s
\n%s' % (make_link('https://www.twitter.com/wdaher/status/287977969287315456'), make_inline_twitter_preview('https://www.twitter.com/wdaher/status/287977969287315456'))) msg = 'http://twitter.com/wdaher/status/287977969287315456' - converted = convert(msg) + converted = bugdown_convert(msg) self.assertEqual(converted, '%s
\n%s' % (make_link('http://twitter.com/wdaher/status/287977969287315456'), make_inline_twitter_preview('http://twitter.com/wdaher/status/287977969287315456'))) # Only one should get converted msg = 'http://twitter.com/wdaher/status/287977969287315456 http://twitter.com/wdaher/status/287977969287315457' - converted = convert(msg) + converted = bugdown_convert(msg) self.assertEqual(converted, '%s %s
\n%s' % (make_link('http://twitter.com/wdaher/status/287977969287315456'), make_link('http://twitter.com/wdaher/status/287977969287315457'), make_inline_twitter_preview('http://twitter.com/wdaher/status/287977969287315456'))) @@ -2283,29 +2285,29 @@ xxxxxxx\nxxxxxxx xxxxx xxxx xxxxx:
\nxxxxxx: xxx
]
# Check every single emoji
- for img in emoji_list:
+ for img in bugdown.emoji_list:
emoji_text = ":%s:" % img
test_cases.append((emoji_text, emoji_img(emoji_text)))
for input, expected in test_cases:
- self.assertEqual(convert(input), '
%s
' % expected) + self.assertEqual(bugdown_convert(input), '%s
' % expected) # Comprehensive test of a bunch of things together msg = 'test :smile: again :poop:\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:' - converted = convert(msg) + converted = bugdown_convert(msg) self.assertEqual(converted, 'test ' + emoji_img(':smile:') + ' again ' + emoji_img(':poop:') + '
\n'
+ ':) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:
Welcome to the jungle
') msg = """You can check out **any time you'd like But you can never leave**""" - converted = convert(msg) + converted = bugdown_convert(msg) self.assertEqual(converted, "You can check out **any time you'd like
\nBut you can never leave**