Ejemplo n.º 1
0
def check_cond(comment):
    text = comment.body
    emotes = ponymotes.parse(text)
    foreign_emotes = []
    for e in emotes:
        if not e.is_default():
            foreign_emotes.append(e)
    return foreign_emotes
Ejemplo n.º 2
0
 def test_default(self):
     post = "[](/pinkiesad) I'm sad."
     emote = ponymotes.parse(post)[0]
     self.assertTrue(emote.is_default())
Ejemplo n.º 3
0
 def test_hashslash(self):
     post = '[](//#bneodestiny)'
     emote = ponymotes.parse(post)[0]
     self.assertEqual('/#bneodestiny', emote.name)
Ejemplo n.º 4
0
 def test_multiple_emotes(self):
     post = '[](/ppsad)[](/flutteryay)'
     emotes = ponymotes.parse(post)
     emotes = list(map(lambda v: v.name, emotes))
     self.assertListEqual(['ppsad', 'flutteryay'], emotes)
Ejemplo n.º 5
0
 def test_colon(self):
     post = '[](/flutter:I)'
     emote = ponymotes.parse(post)[0]
     self.assertEqual('flutter:I', emote.name)
Ejemplo n.º 6
0
 def test_tooltip(self):
     post = '[](/fluttershy "Say what?")'
     emote = ponymotes.parse(post)[0]
     self.assertEqual('Say what?', emote.tooltip)
Ejemplo n.º 7
0
 def test_text(self):
     post = "[RIP Applejack](/gravestone)"
     emote = ponymotes.parse(post)[0]
     self.assertEqual('RIP Applejack', emote.text)
Ejemplo n.º 8
0
 def test_modifiers(self):
     post = "[](/cadence-intensifies-spin)"
     emote = ponymotes.parse(post)[0]
     self.assertIn(member="intensifies", container=emote.modifiers)
Ejemplo n.º 9
0
 def test_name(self):
     post = "[](/dieinahole)"
     emote = ponymotes.parse(post)[0]
     self.assertEqual('dieinahole', emote.name)