Ejemplo n.º 1
0
def test_queue_running(db, api_client):
    """ Just the very minimal basics for now: makes sure that the methods run
        without raising an exception. You can use rq-dashboard and a Gmail
        browser window to look in more depth. We'll want to add some
        automatic verification of the behaviour here eventually (see the
        previous tests), but for now I'm leaving it lean and fast.
    """
    from inbox.server.actions.base import rqworker
    # "Tips for using Gmail" thread (avoiding all the "Postel lives!" ones)
    api_client.archive(USER_ID, NAMESPACE_ID, 8)
    api_client.move(USER_ID, NAMESPACE_ID, 8, 'archive', 'inbox')
    # process actions queue
    rqworker(burst=True)
Ejemplo n.º 2
0
    def test_local_archive(self, db, api_client, action_queue):
        from inbox.server.models.tables.base import FolderItem

        result = api_client.archive(USER_ID, NAMESPACE_ID, 1)
        assert result == "OK", "archive API call failed"

        inbox_items = db.session.query(FolderItem).filter_by(
            thread_id=1, folder_name='inbox').count()
        assert inbox_items == 0, "inbox entry still present"

        archive_items = db.session.query(FolderItem).filter_by(
            thread_id=1, folder_name='archive').count()
        assert archive_items == 1, "archive entry missing"

        assert action_queue.count == 1, "sync-back event not queued"