<reponame>kostya-ten/iperon
import asyncio

import pytest

from iperon import cron, contrib


@pytest.mark.asyncio
async def test_test_cron(app):
    assert await cron.test_cron()


@pytest.mark.asyncio
async def test_remove_old_session(app):
    await contrib.session.create(
        expires=1,
        data={'hello': 'word!'},
        category=contrib.session.Category.sign_up
    )
    await asyncio.sleep(1)
    assert await cron.remove_old_session()
