def test_mixing_together(self):
     message = RefAttach('user1') + ImageAttach('http://image.url') + LocationAttach('home', 32, 83) + SplitAttach(
         'token') + EmojiAttach(13, 9)
     self.assertEqual(message.get_text(), 'hometoken\ufffd')
     self.assertEqual(message.get_attachments(), [
         {
             'type': 'mentions',
             'loci': [[0, 0]],
             'user_ids': ['user1'],
         },
         {
             'type': 'image',
             'url': 'http://image.url',
         },
         {
             'type': 'location',
             'name': 'home',
             'lat': 32,
             'long': 83,
         },
         {
             'type': 'split',
             'token': 'token',
         },
         {
             'type': 'emoji',
             'charmap': [[13, 9]],
             'placeholder': '\ufffd',
         }
     ])
 def test_multiple_split(self):
     message = RefAttach('red_id', '@red') + ' vs. ' + RefAttach('blue_id', '@blue')
     self.assertEqual(message.get_text(), '@red vs. @blue')
     self.assertEqual(message.get_attachments(), [{
         'type': 'mentions',
         'loci': [[0, 4], [9, 5]],
         'user_ids': ['red_id', 'blue_id']
     }])
    def test_dynamic_creation_reverse_order(self):
        message = RefAttach('user_id_here', '@world') + ' how are you?'

        self.assertEqual(message.get_text(), '@world how are you?')
        self.assertEqual(message.get_attachments(), [{
            'loci': [[0, 6]],
            'type': 'mentions',
            'user_ids': ['user_id_here']
        }])
    def test_dynamic_creation_reverse_order(self) -> None:
        message = RefAttach("user_id_here", "@world") + " how are you?"

        self.assertEqual(message.get_text(), "@world how are you?")
        self.assertEqual(
            message.get_attachments(),
            [{
                "loci": [[0, 6]],
                "type": "mentions",
                "user_ids": ["user_id_here"]
            }],
        )
 def test_multiple_split(self) -> None:
     message = RefAttach("red_id", "@red") + " vs. " + RefAttach(
         "blue_id", "@blue")
     self.assertEqual(message.get_text(), "@red vs. @blue")
     self.assertEqual(
         message.get_attachments(),
         [{
             "type": "mentions",
             "loci": [[0, 4], [9, 5]],
             "user_ids": ["red_id", "blue_id"],
         }],
     )
 def test_forward_add(self) -> None:
     message = RefAttach("user_id", "@test") + ComplexMessage(", whats up?")
     self.assertEqual(message.get_text(), "@test, whats up?")