Ejemplo n.º 1
0
def setUpModule():
    os.environ['GIRDER_PORT'] = os.environ.get('GIRDER_TEST_PORT', '20200')
    config.loadConfig()
    base.mockPluginDir(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'test_plugins'))
    base.enabledPlugins = ['test_plugin']

    base.startServer(mock=False)
def setUpModule():
    os.environ['GIRDER_PORT'] = os.environ.get('GIRDER_TEST_PORT', '20200')
    config.loadConfig()
    base.mockPluginDir(
        os.path.join(os.path.dirname(os.path.dirname(__file__)),
                     'test_plugins'))
    base.enabledPlugins = ['test_plugin']

    base.startServer(mock=False)
Ejemplo n.º 3
0
def setUpModule():
    os.environ['GIRDER_PORT'] = os.environ.get('GIRDER_TEST_PORT', '20200')
    config.loadConfig()
    testPluginPath = os.path.normpath(
        os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..',
                     'test', 'test_plugins'))
    base.mockPluginDir(testPluginPath)
    base.enabledPlugins = ['test_plugin']

    with mock.patch('girder.utility.plugin_utilities.logprint.exception'):
        base.startServer(mock=False)
Ejemplo n.º 4
0
def setUpModule():
    os.environ['GIRDER_PORT'] = os.environ.get('GIRDER_TEST_PORT', '20200')
    config.loadConfig()
    testPluginPath = os.path.normpath(os.path.join(
        os.path.dirname(os.path.abspath(__file__)), '..', '..', 'test', 'test_plugins'
    ))
    base.mockPluginDir(testPluginPath)
    base.enabledPlugins = ['test_plugin']

    with mock.patch('girder.utility.plugin_utilities.logprint.exception'):
        base.startServer(mock=False)
Ejemplo n.º 5
0
#  See the License for the specific language governing permissions and
#  limitations under the License.
###############################################################################

import os
import requests
import time

from .. import base
from girder import config
from girder.api import access
from girder.api.rest import Resource, iterBody

_chunks = []
os.environ['GIRDER_PORT'] = os.environ.get('GIRDER_TEST_PORT', '20200')
config.loadConfig()  # Must reload config to pickup correct port


def setUpModule():
    server = base.startServer(mock=False)
    server.root.api.v1.stream_test = StreamTestResource()


def tearDownModule():
    base.stopServer()


class StreamTestResource(Resource):
    def __init__(self):
        super(StreamTestResource, self).__init__()
        self.resourceName = 'stream_test'
Ejemplo n.º 6
0
import os
import requests
import shutil
import sys
import six
import httmock

from girder import config
from girder.models.api_key import ApiKey
from girder.models.folder import Folder
from girder.models.user import User
from tests import base
from six import StringIO

os.environ['GIRDER_PORT'] = os.environ.get('GIRDER_TEST_PORT', '20200')
config.loadConfig()  # Must reload config to pickup correct port


@contextlib.contextmanager
def captureOutput():
    oldout, olderr = sys.stdout, sys.stderr
    try:
        out = [StringIO(), StringIO()]
        sys.stdout, sys.stderr = out
        yield out
    finally:
        sys.stdout, sys.stderr = oldout, olderr
        out[0] = out[0].getvalue()
        out[1] = out[1].getvalue()

Ejemplo n.º 7
0
import time

from girder import config
from girder.api import access
from girder.api.describe import Description, describeRoute
from girder.api.rest import Resource
from girder.constants import registerAccessFlag, ROOT_DIR
from girder.exceptions import RestException
from girder.models.folder import Folder
from girder.models.upload import Upload
from girder.utility.progress import ProgressContext
from . import base
from six.moves import range

os.environ['GIRDER_PORT'] = os.environ.get('GIRDER_PORT', '30001')
config.loadConfig()  # Reload config to pick up correct port
testServer = None


def setUpModule():
    global testServer
    mockS3 = False
    if 's3' in os.environ['ASSETSTORE_TYPE']:
        mockS3 = True

    plugins = os.environ.get('ENABLED_PLUGINS', '')
    if plugins:
        base.enabledPlugins.extend(plugins.split())

    testServer = base.startServer(False, mockS3=mockS3)
Ejemplo n.º 8
0
import six
import subprocess
import sys
import time

from girder import config
from girder.api import access
from girder.api.describe import Description
from girder.api.rest import Resource, RestException
from girder.constants import ROOT_DIR
from girder.utility.progress import ProgressContext
from . import base
from six.moves import range

os.environ["GIRDER_PORT"] = os.environ.get("GIRDER_PORT", "30001")
config.loadConfig()  # Reload config to pick up correct port
testServer = None


def setUpModule():
    global testServer
    mockS3 = False
    if "s3" in os.environ["ASSETSTORE_TYPE"]:
        mockS3 = True

    pluginDirs = os.environ.get("PLUGIN_DIRS", "")

    if pluginDirs:
        curConfig = config.getConfig()
        curConfig["plugins"] = {"plugin_directory": pluginDirs}
Ejemplo n.º 9
0
def setUpModule():
    os.environ['GIRDER_PORT'] = os.environ.get('GIRDER_TEST_PORT', '20200')
    config.loadConfig()
    base.startServer(mock=False)
Ejemplo n.º 10
0
def setUpModule():
    global testServer
    os.environ['GIRDER_PORT'] = os.environ.get('GIRDER_TEST_PORT', '20200')
    config.loadConfig()
    testServer = base.startServer(mock=False)
Ejemplo n.º 11
0
from six import BytesIO

import requests

import PIL.Image

from tests import base

from girder import config
from girder.constants import SortDir

import common


os.environ['GIRDER_PORT'] = os.environ.get('GIRDER_TEST_PORT', '20200')
config.loadConfig()


def setUpModule():
    base.enabledPlugins.append('larger_image')
    base.startServer(False)


def tearDownModule():
    base.stopServer()


class LargeImageTilesTest(common.LargeImageCommonTest):
    def testTile(self):
        file = self._uploadFile(os.path.join(
            os.path.dirname(__file__), 'test_files', 'grey10kx5kdeflate.tif'))