2014-02-19 15:38:13 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
"""
|
|
|
|
Copyright 2014 Google Inc.
|
|
|
|
|
|
|
|
Use of this source code is governed by a BSD-style license that can be
|
|
|
|
found in the LICENSE file.
|
|
|
|
|
|
|
|
A wrapper around the standard Python unittest library, adding features we need
|
|
|
|
for various unittests within this directory.
|
|
|
|
"""
|
|
|
|
|
2014-07-17 19:54:16 +00:00
|
|
|
# System-level imports.
|
2014-02-19 15:38:13 +00:00
|
|
|
import os
|
2014-07-17 19:54:16 +00:00
|
|
|
import sys
|
2014-02-19 15:38:13 +00:00
|
|
|
|
2014-07-17 19:54:16 +00:00
|
|
|
PARENT_DIR = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
TRUNK_DIR = os.path.abspath(os.path.join(PARENT_DIR, os.pardir, os.pardir))
|
2014-02-19 15:38:13 +00:00
|
|
|
|
2014-07-17 19:54:16 +00:00
|
|
|
# Import the superclass base_unittest module from the tools dir.
|
2014-08-05 17:07:22 +00:00
|
|
|
#
|
|
|
|
# TODO(epoger): If I don't put this at the beginning of sys.path, the import of
|
|
|
|
# tests.base_unittest fails. That's bad. I need to come up with a cleaner way
|
|
|
|
# of doing this... I think this will involve changing how we import the "boto"
|
|
|
|
# library in gs_utils.py, within the common repo.
|
2014-07-17 19:54:16 +00:00
|
|
|
TOOLS_DIR = os.path.join(TRUNK_DIR, 'tools')
|
2014-08-05 17:07:22 +00:00
|
|
|
if TOOLS_DIR != sys.path[0]:
|
|
|
|
sys.path.insert(0, TOOLS_DIR)
|
2014-07-17 19:54:16 +00:00
|
|
|
import tests.base_unittest as superclass_module
|
2014-02-19 15:38:13 +00:00
|
|
|
|
|
|
|
|
2014-07-17 19:54:16 +00:00
|
|
|
class TestCase(superclass_module.TestCase):
|
2014-07-16 15:28:23 +00:00
|
|
|
|
2014-07-17 19:54:16 +00:00
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super(TestCase, self).__init__(*args, **kwargs)
|
|
|
|
# Some of the tests within this package want their output validated,
|
|
|
|
# so we declare where the expected and actual output will be.
|
|
|
|
self._testdata_dir = os.path.join(PARENT_DIR, 'testdata')
|
2014-02-19 15:38:13 +00:00
|
|
|
|
2014-07-17 19:54:16 +00:00
|
|
|
def main(*args, **kwargs):
|
|
|
|
superclass_module.main(*args, **kwargs)
|