示例#1
0
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
0
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()
示例#3
0
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()
示例#4
0
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()
示例#5
0
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()
示例#6
0
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()
示例#7
0
def run_tests_parralel():
  if six.PY2:
    test_env.setup_test_env()

  # append attribute filter option "--attribute '!no_run'"
  # https://nose2.readthedocs.io/en/latest/plugins/attrib.html
  sys.argv.extend(['--attribute', '!no_run'])

  return parallel_test_runner.run_tests(python3=six.PY3)
示例#8
0
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()
示例#9
0
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()
#!/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):
示例#11
0
#!/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, '*****@*****.**')
    self.assertTrue(isinstance(ident, tuple))