2011-08-26 11:21:26 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
"""
|
2014-08-31 21:54:45 +02:00
|
|
|
tests.examples
|
2011-08-26 11:21:26 +01:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
Tests the examples.
|
|
|
|
|
|
2014-01-02 19:21:07 +01:00
|
|
|
:copyright: (c) 2014 by Armin Ronacher.
|
2011-08-26 11:21:26 +01:00
|
|
|
:license: BSD, see LICENSE for more details.
|
|
|
|
|
"""
|
|
|
|
|
import os
|
|
|
|
|
import unittest
|
2014-08-31 21:54:45 +02:00
|
|
|
from tests import add_to_path
|
2011-08-26 11:21:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def setup_path():
|
|
|
|
|
example_path = os.path.join(os.path.dirname(__file__),
|
|
|
|
|
os.pardir, os.pardir, 'examples')
|
|
|
|
|
add_to_path(os.path.join(example_path, 'flaskr'))
|
|
|
|
|
add_to_path(os.path.join(example_path, 'minitwit'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def suite():
|
|
|
|
|
setup_path()
|
|
|
|
|
suite = unittest.TestSuite()
|
|
|
|
|
try:
|
2014-08-31 21:56:15 +02:00
|
|
|
from minitwit_tests import TestMiniTwit
|
2011-08-26 11:21:26 +01:00
|
|
|
except ImportError:
|
|
|
|
|
pass
|
|
|
|
|
else:
|
2014-08-31 21:56:15 +02:00
|
|
|
suite.addTest(unittest.makeSuite(TestMiniTwit))
|
2011-08-26 11:21:26 +01:00
|
|
|
try:
|
2014-08-31 21:56:15 +02:00
|
|
|
from flaskr_tests import TestFlaskr
|
2011-08-26 11:21:26 +01:00
|
|
|
except ImportError:
|
|
|
|
|
pass
|
|
|
|
|
else:
|
2014-08-31 21:56:15 +02:00
|
|
|
suite.addTest(unittest.makeSuite(TestFlaskr))
|
2011-08-26 11:21:26 +01:00
|
|
|
return suite
|