async def test_get_message(self):
        """Test that listening consumes from the socket."""

        async def iter_chuncked1(n=None):
            response = [{"message": "hi"}, {"message": "hi"}]
            for doc in response:
                yield doc

        response1 = amock.CoroutineMock()
        response1.content.iter_chunked = iter_chuncked1

        connector = ConnectorGitter(
            {"bot-name": "github", "room-id": "test-id", "access-token": "test-token"},
            opsdroid=OpsDroid(),
        )
        connector.parse_message = amock.CoroutineMock()
        connector.opsdroid.parse = amock.CoroutineMock()
        connector.response = response1
        assert await connector._get_messages() is None
        self.assertTrue(connector.parse_message.called)
        self.assertTrue(connector.opsdroid.parse.called)
    async def test_get_message(self):
        """Test that listening consumes from the socket."""

        BOT_GITTER_ID = "12345"
        OTHER_GITTER_ID = "67890"

        async def iter_chuncked1(n=None):
            response = [
                {
                    "text": "hi",
                    "fromUser": {
                        "username": "******",
                        "id": OTHER_GITTER_ID
                    },
                },
                {
                    "text": "hi",
                    "fromUser": {
                        "username": "******",
                        "id": BOT_GITTER_ID
                    }
                },
                {
                    "text": "hi",
                    "fromUser": {
                        "username": "******",
                        "id": OTHER_GITTER_ID
                    },
                },
            ]
            for doc in response:
                yield json.dumps(doc).encode()

        response1 = amock.CoroutineMock()
        response1.content.iter_chunked = iter_chuncked1

        connector = ConnectorGitter(
            {
                "bot-name": "github",
                "room-id": "test-id",
                "token": "test-token"
            },
            opsdroid=OpsDroid(),
        )
        # Connect first, in order to set bot_gitter_id.
        with amock.patch("aiohttp.ClientSession.get") as patched_request:
            mockresponse = amock.CoroutineMock()
            mockresponse.status = 200
            mockresponse.json = amock.CoroutineMock(return_value={
                "login": "******",
                "id": BOT_GITTER_ID,
                "username": "******",
            })
            patched_request.return_value = asyncio.Future()
            patched_request.return_value.set_result(mockresponse)
            await connector.connect()

        connector.opsdroid.parse = amock.CoroutineMock()
        connector.response = response1
        assert await connector._get_messages() is None
        # Should be called *twice* given these three messages (skipping own message)
        assert connector.opsdroid.parse.call_count == 2