old_contents: import pytest
  import linkatos.parser as parser
  
  
  # test message parsing
  def test_ignore_linkatos_message():
      input_example = [{
          'user': 'bot_id',
          'channel': 'channel',
          'text': 'http://example.org'
      }]
  
      output = {'out': None, 'channel': None, 'type': None}
  
      assert parser.parse(input_example, 'bot_id') == output
  
  
  def test_is_of_url_type():
      input_example = [{
           'channel': 'channel',
           'text': '<http://example.org>',
           'user': 'user'
      }]
  
      output = {'out': 'http://example.org', 'channel': 'channel', 'type': 'url'}
  
      assert parser.parse(input_example, 'bot_id') == output
  
  
  def test_is_of_ynanswer_type_yes():
      input_example = [{
           'channel': 'channel',
           'text': 'yes',
           'user': 'user'
      }]
  
      output = {'out': True, 'channel': 'channel', 'type': 'yn_answer'}
  
      assert parser.parse(input_example, 'bot_id') == output
  
  
  def test_is_of_ynanswer_type_no():
      input_example = [{
           'channel': 'channel',
           'text': 'No',
           'user': 'user'
      }]
  
      output = {'out': False, 'channel': 'channel', 'type': 'yn_answer'}
  
      assert parser.parse(input_example, 'bot_id') == output
  
  
  def test_channelin_channelout():
      input_example = [{
           'channel': 'channel_in',
           'text': 'yes',
           'user': 'user'
      }]
  
      output = {'out': True, 'channel': 'channel_in', 'type': 'yn_answer'}
  
      assert parser.parse(input_example, 'bot_id') == output
  
new_contents: import pytest
  import linkatos.parser as parser
  
  
  # test message parsing
  def test_ignore_linkatos_message():
      message = [{
          'user': 'bot_id',
          'channel': 'channel',
          'text': 'http://example.org'
      }]
  
      parsed = {'message': None,
                'channel': None,
                'ts': None,
                'item_ts': None,
                'type': None,
                'user': None,
                'item_user': None}
  
  
      assert parser.parse(message, 'bot_id') == parsed
  
  
  def test_capture_reaction():
      message = {
          'reaction': '+1',
          'channel': 'example_channel',
          'item': {
              'channel': 'example_channel',
              'ts': 1234.1234
          },
          'user': 'example_user',
          'item_user': 'example_item_user'
      }
  
      reaction= {
          'message': '+1',
          'channel': 'example_channel',
          'item_ts': 1234.1234,
          'type': 'reaction',
          'user': 'example_user',
          'item_user': 'example_item_user'
      }
  
      assert parser.capture_reaction(message) == reaction
  
  
  def test_capture_url():
      message = {
          'channel': 'example_channel',
          'ts': 1234.1234,
          'user': 'example_user',
      }
  
      url = 'http://foo.bar'
  
      parsed_url = {
          'message': 'http://foo.bar',
          'channel': 'example_channel',
          'ts': 1234.1234,
          'type': 'url',
          'user': 'example_user',
      }
  
      assert parser.capture_url(message, url) == parsed_url
  
subject: Add parse tests