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()
def setup_test_env(app_id='sample-app'): """Sets up App Engine/Django test environment.""" global _INITIALIZED if _INITIALIZED: raise Exception('Do not call test_env.setup_test_env() twice.') _INITIALIZED = True # For 'from components import ...' and 'from test_support import ...'. sys.path.insert(0, ROOT_DIR) sys.path.insert(0, os.path.join(ROOT_DIR, '..', 'third_party_local')) from tool_support import gae_sdk_utils gae_sdk_utils.setup_gae_env() gae_sdk_utils.setup_env(None, app_id, 'v1a', None) from components import utils utils.fix_protobuf_package()
def setup_test_env(app_id='sample-app'): """Sets up App Engine test environment.""" global _INITIALIZED if _INITIALIZED: return _INITIALIZED = True # For depot_tools. sys.path.insert( 0, os.path.join(ROOT_DIR, '..', '..', 'client', 'third_party')) # For 'from components import ...' and 'from test_support import ...'. sys.path.insert(0, ROOT_DIR) sys.path.insert(0, os.path.join(ROOT_DIR, '..', 'third_party_local')) from tool_support import gae_sdk_utils gae_sdk_utils.setup_gae_env() gae_sdk_utils.setup_env(None, app_id, 'v1a', None) from components import utils utils.fix_protobuf_package()
#!/usr/bin/env python # Copyright 2018 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. import sys import unittest from test_support import test_env test_env.setup_test_env() # google.protobuf package requires some python package magic hacking. from components import utils utils.fix_protobuf_package() from google.protobuf import field_mask_pb2 import field_masks import test_proto_pb2 # Shortcuts. TestMsg = test_proto_pb2.Msg TEST_DESC = TestMsg.DESCRIPTOR STAR = field_masks.STAR Mask = field_masks.Mask class ParsePathTests(unittest.TestCase): def parse(self, path, **kwargs):
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Access to bucket configurations. Stores bucket list in datastore, synchronizes it with bucket configs in project repositories: `projects/<project_id>:<buildbucket-app-id>.cfg`. """ import hashlib import logging from components import utils utils.fix_protobuf_package() from google import protobuf from google.appengine.api import app_identity from google.appengine.ext import ndb from components import auth from components import config from components.config import validation from proto import project_config_pb2 from swarming import swarmingcfg import errors @utils.cache def cfg_path():
# Copyright 2015 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. components_ereporter2_RECIPIENTS_AUTH_GROUP = 'config-ereporter2-reports' from components.utils import fix_protobuf_package fix_protobuf_package()