Beispiel #1
0
#!/usr/bin/env python3

from shorty import app
app.run()
Beispiel #2
0
    if sys.argv[1] == 'shell':
        import IPython

        mktestbed()
        IPython.Shell.start().mainloop()
    elif sys.argv[1] == 'runserver':
        from shorty import app
        try:
            from shorty import settings
        except ImportError:
            logging.error('Could not find settings. Aborting...')
            sys.exit(1)

        app.config.from_object(settings)

        from shorty.routes import *
        from shorty.database import init_db
        init_db()
        app.run(debug=True)
    elif sys.argv[1] == 'test':
        from shorty import app
        import unittest2 as unittest
        import logging
        import sys

        mktestbed()

        path = sys.argv[2] if len(sys.argv) == 3 else './tests'
        suite = unittest.loader.TestLoader().discover(path)
        unittest.TextTestRunner(verbosity=2).run(suite)