# Path: gap/utils/setup.py
# def fix_sys_path(app_src=None):
#     global _PATH_FIXED
#     if not _PATH_FIXED:
#         gae_path = find_gae_runtime_path()
#         sys.path.insert(0, gae_path)
#         # sys.path.insert(0, join(gae_path, 'lib'))
#         import dev_appserver
#         dev_appserver.fix_sys_path()
#         _PATH_FIXED = 1
# 
#     if app_src and _PATH_FIXED < 2:
#         sys.path.insert(0, app_src)
#         _PATH_FIXED = 2
# 
# def setup_testbed(stubs=DEFAULT_TESTBEDS, env={}):
#     from google.appengine.ext import testbed
#     t = testbed.Testbed()
#     if env:
#         t.setup_env(**env)
#     t.activate()
#     for stub in stubs:
#         if stub == 'datastore':
#             stub = 'datastore_v3'
#         getattr(t, 'init_%s_stub' % stub)()
#         if stub == 'urlfetch':
#             t.urlfetch_stub = t.get_stub('urlfetch')
#         elif stub == 'mail':
#             t.mail_stub = t.get_stub(testbed.MAIL_SERVICE_NAME)
#     import app
#     return t


import sys
import os
import logging
import nose
import re
from os.path import dirname, realpath, join
from gap.utils.setup import fix_sys_path, setup_testbed
#!/usr/bin/env python
'''
simple shortcut for running nosetests via python
replacement for *.bat or *.sh wrappers
'''


app_path = dirname(realpath(__file__))

# Path: gap/utils/setup.py
# def fix_sys_path(app_src=None):
#     global _PATH_FIXED
#     if not _PATH_FIXED:
#         gae_path = find_gae_runtime_path()
#         sys.path.insert(0, gae_path)
#         # sys.path.insert(0, join(gae_path, 'lib'))
#         import dev_appserver
#         dev_appserver.fix_sys_path()
#         _PATH_FIXED = 1
# 
#     if app_src and _PATH_FIXED < 2:
#         sys.path.insert(0, app_src)
#         _PATH_FIXED = 2
# 
# def setup_testbed(stubs=DEFAULT_TESTBEDS, env={}):
#     from google.appengine.ext import testbed
#     t = testbed.Testbed()
#     if env:
#         t.setup_env(**env)
#     t.activate()
#     for stub in stubs:
#         if stub == 'datastore':
#             stub = 'datastore_v3'
#         getattr(t, 'init_%s_stub' % stub)()
#         if stub == 'urlfetch':
#             t.urlfetch_stub = t.get_stub('urlfetch')
#         elif stub == 'mail':
#             t.mail_stub = t.get_stub(testbed.MAIL_SERVICE_NAME)
#     import app
#     return t


# Path: gap/tests/run_tests.py
import sys
import os
import logging
import nose
import re
from os.path import dirname, realpath, join
from gap.utils.setup import fix_sys_path, setup_testbed

#!/usr/bin/env python
'''
simple shortcut for running nosetests via python
replacement for *.bat or *.sh wrappers
'''


app_path = dirname(realpath(__file__))

fix_sys_path()