#!/usr/bin/env python3
# coding:utf-8

import myorm
import asyncio
import sys
import logging;logging.basicConfig(level=logging.INFO)
from mymodel import User, Blog, Comment

async def test():
    await myorm.create_pool(user='www-data', password='<PASSWORD>',
                            db='awesome', loop=loop)
    for i in range(0, 1000):
        name = 'Test{0}'.format(i)
        email = '<EMAIL>(i)
        passwd = '<PASSWORD>{0}'.format(i)
        image = 'image{0}'.format(i)
        u = User(name=name, email=email, passwd=<PASSWORD>,
             image=image)
        await u.save()
    await myorm.destory_pool()
    logging.info('test ok')

loop = asyncio.get_event_loop()
loop.run_until_complete(test())

loop.close()
if loop.is_closed():
    sys.exit(0)

#!/usr/bin/env python3
# coding:utf-8

import myorm
import asyncio
import sys
import logging;logging.basicConfig(level=logging.INFO)
from mymodel import User, Blog, Comment

async def test():
    await myorm.create_pool(user='www-data', password='<PASSWORD>',
                            db='awesome', loop=loop)
    for i in range(0, 1000):
        name = 'Test{0}'.format(i)
        email = '<EMAIL>(i)
        passwd = '<PASSWORD>{0}'.format(i)
        image = 'image{0}'.format(i)
        u = User(name=name, email=email, passwd=<PASSWORD>,
             image=image)
        await u.save()
    await myorm.destory_pool()
    logging.info('test ok')

loop = asyncio.get_event_loop()
loop.run_until_complete(test())

loop.close()
if loop.is_closed():
    sys.exit(0)

#!/usr/bin/env python3 # coding:utf-8