本文整理汇总了Python中test_support.test_env.setup_test_env函数的典型用法代码示例。如果您正苦于以下问题:Python setup_test_env函数的具体用法?Python setup_test_env怎么用?Python setup_test_env使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setup_test_env函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_test_env
def setup_test_env():
"""Sets up App Engine test environment."""
# For application modules.
sys.path.insert(0, APP_DIR)
from test_support import test_env
test_env.setup_test_env()
示例2: setup_test_env
def setup_test_env():
"""Sets up App Engine test environment."""
sys.path.insert(0, os.path.join(COMPONENTS_DIR, 'third_party'))
if COMPONENTS_DIR not in sys.path:
sys.path.insert(0, COMPONENTS_DIR)
from test_support import test_env
test_env.setup_test_env()
示例3: setup_test_env
def setup_test_env():
"""Sets up App Engine test environment."""
# For application modules.
sys.path.insert(0, APP_DIR)
# TODO(maruel): Remove.
sys.path.insert(0, os.path.join(APP_DIR, 'components', 'third_party'))
from test_support import test_env
test_env.setup_test_env()
示例4: setup_test_env
def setup_test_env():
"""Sets up App Engine test environment."""
sys.path.insert(0, APP_DIR)
from test_support import test_env
test_env.setup_test_env()
sys.path.insert(0, THIRD_PARTY)
from components import utils
utils.fix_protobuf_package()
示例5: IdentityTest
#!/usr/bin/env python
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
import datetime
import sys
import unittest
from test_support import test_env
test_env.setup_test_env()
from google.appengine.ext import ndb
from components import utils
from components.auth import ipaddr
from components.auth import model
from test_support import test_case
class IdentityTest(test_case.TestCase):
"""Tests for Identity class."""
def test_immutable(self):
# Note that it's still possible to add new attributes to |ident|. To fix
# this we'd have to add __slots__ = () to Identity and to BytesSerializable
# (it inherits from). Since adding extra attributes to an instance doesn't
# harm any expected behavior of Identity (like equality operator or
# serialization) we ignore this hole in immutability.
ident = model.Identity(model.IDENTITY_USER, '[email protected]')
self.assertTrue(isinstance(ident, tuple))