Exemple #1
0
    def testAdditionalPaths(self):
        bindir = _ensureDir(self.tempdir, "bin")

        systemPath = []
        includeParentAndDeps(join(bindir, "thefile.py"),
                             systemPath=systemPath,
                             additionalPaths=['1', '2'])
        self.assertEqual(set(['1', '2', self.tempdir]), set(systemPath))
Exemple #2
0
 def testIncludeParentAndDepsScanForParent(self):
     bindir = _ensureDir(self.tempdir, "level1", "level2", "bin")
     depOne = _ensureDir(self.tempdir, "deps.d", "dep_one")
     systemPath = []
     includeParentAndDeps(join(bindir, "thefile.py"),
                          systemPath=systemPath,
                          scanForDeps=True)
     self.assertEquals(set([self.tempdir, depOne]), set(systemPath))
Exemple #3
0
    def testIncludeParentAndDeps(self):
        bindir = _ensureDir(self.tempdir, "bin")

        systemPath = []
        includeParentAndDeps(join(bindir, "thefile.py"), systemPath=systemPath)
        self.assertEquals([self.tempdir], systemPath)
        depOne = _ensureDir(self.tempdir, "deps.d", "dep_one")
        depTwo = _ensureDir(self.tempdir, "deps.d", "dep_two")
        systemPath = []
        includeParentAndDeps(join(bindir, "thefile.py"), systemPath=systemPath)
        self.assertEquals(set([self.tempdir, depOne, depTwo]), set(systemPath))
Exemple #4
0
    def testAdditionalPathsRelativeFromParent(self):
        bindir = _ensureDir(self.tempdir, "bin")

        systemPath = []
        includeParentAndDeps(join(bindir, "thefile.py"),
                             systemPath=systemPath,
                             additionalPaths=['1', '2'],
                             additionalPathsRelativeFromParent=True)
        self.assertEqual(
            set([
                join(self.tempdir, '1'),
                join(self.tempdir, '2'), self.tempdir
            ]), set(systemPath))
Exemple #5
0
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with "Meresco Examples"; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
## end license ##

from os import getuid
import sys
assert getuid() != 0, "Do not run tests as 'root'"

from seecrdeps import includeParentAndDeps  #DO_NOT_DISTRIBUTE
includeParentAndDeps(__file__, scanForDeps=True)  #DO_NOT_DISTRIBUTE

from seecr.test.testrunner import TestRunner
from _integration import ExampleIntegrationState

if __name__ == '__main__':
    runner = TestRunner()
    # Setting fastmode to True, will SKIP the upload part, and reuse existing database/store for the integration tests.
    runner.fastMode = False
    print "FASTMODE:", runner.fastMode

    ExampleIntegrationState("seecr",
                            tests=[
                                '_integration.gatewaytest.GatewayTest',
                                '_integration.apitest.ApiTest',
                                '_integration.sruslavetest.SruSlaveTest',
Exemple #6
0
# "Meresco Harvester" is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with "Meresco Harvester"; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
## end license ##

from os import getuid
assert getuid() != 0, "Do not run tests as 'root'"

from seecrdeps import includeParentAndDeps, cleanup     #DO_NOT_DISTRIBUTE
includeParentAndDeps(__file__)                          #DO_NOT_DISTRIBUTE
cleanup(__file__)                                       #DO_NOT_DISTRIBUTE

import unittest

from deleteidstest import DeleteIdsTest
from eventloggertest import EventLoggerTest
from filesystemuploadtest import FileSystemUploaderTest
from harvestactiontest import HarvestActionTest
from harvesterdataactionstest import HarvesterDataActionsTest
from harvesterdataretrievetest import HarvesterDataRetrieveTest
from harvesterdatatest import HarvesterDataTest
from harvesterlogtest import HarvesterLogTest
from harvestertest import HarvesterTest
from idstest import IdsTest
from internalserverproxytest import InternalServerProxyTest
Exemple #7
0
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# "Meresco Lucene" is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with "Meresco Lucene"; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
## end license ##

from seecrdeps import includeParentAndDeps       #DO_NOT_DISTRIBUTE
includeParentAndDeps(__file__, scanForDeps=True) #DO_NOT_DISTRIBUTE

from os.path import dirname, abspath, join, realpath
from sys import stdout

from weightless.http import HttpRequest1_1, SocketPool
from weightless.io import Reactor
from weightless.core import compose, be
from meresco.core import Observable, TransactionScope, Transparent
from meresco.core.processtools import setSignalHandlers
from meresco.components import Xml2Fields, Venturi, XmlPrintLxml, FilterField, RenameField, FilterMessages, TransformFieldValue, ParseArguments
from meresco.components.http import StringServer, ObservableHttpServer, BasicHttpHandler, ApacheLogger, PathFilter, PathRename, FileServer
from meresco.components.http.utils import ContentTypePlainText
from meresco.components.sru import SruRecordUpdate, SruParser, SruHandler, SruDuplicateCount
from meresco.components.drilldown import SRUTermDrilldown
from meresco.components.autocomplete import Autocomplete
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# "Meresco Lucene" is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with "Meresco Lucene"; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
## end license ##

from seecrdeps import includeParentAndDeps  #DO_NOT_DISTRIBUTE
includeParentAndDeps(__file__)  #DO_NOT_DISTRIBUTE

import unittest
from sys import version
if version >= '2.7':
    from warnings import simplefilter
    simplefilter('default')

from composedquerytest import ComposedQueryTest
from conversiontest import ConversionTest
from converttocomposedquerytest import ConvertToComposedQueryTest
from extractfilterqueriestest import ExtractFilterQueriesTest
from fieldregistrytest import FieldRegistryTest
from fields2lucenedoctest import Fields2LuceneDocTest
from fieldslisttolucenedocumenttest import FieldsListToLuceneDocumentTest
from lucenequerycomposertest import LuceneQueryComposerTest
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with "Meresco Examples"; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
## end license ##

from os import getuid
import sys
assert getuid() != 0, "Do not run tests as 'root'"

from seecrdeps import includeParentAndDeps

includeParentAndDeps(__file__, scanForDeps=True)

from seecr.test.testrunner import TestRunner
from _integration import GmhTestIntegrationState

if __name__ == '__main__':  #TODO: arg[0] fastMode uitlezen.
    runner = TestRunner()
    # Setting fastmode to True, will SKIP the upload part, and reuse existing database/store for the integration tests.
    runner.fastMode = False
    print "FASTMODE:", runner.fastMode

    GmhTestIntegrationState("brigmh",
                            tests=[
                                '_integration.gatewaytest.GatewayTest',
                                '_integration.apitest.ApiTest',
                                '_integration.resolvertest.ResolverTest',
# (at your option) any later version.
#
# "Digitale Collectie ErfGeo Enrichment" is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with "Digitale Collectie ErfGeo Enrichment"; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
## end license ##

from os.path import dirname, abspath
from seecrdeps import includeParentAndDeps  #DO_NOT_DISTRIBUTE
includeParentAndDeps(dirname(dirname(abspath(__file__))))  #DO_NOT_DISTRIBUTE

import sys; print 'path', sys.path; sys.stdout.flush()

from collections import defaultdict

from simplejson import dump

from meresco.oai.tools import iterateOaiPmh

from digitalecollectie.erfgeo.namespaces import xpath, xpathFirst


def main():
    for set in ['rijksmuseum']: #'NIOD', 'zeeuwse_bibliotheek', 'limburgs_erfgoed', 'geluidVanNl']:
        print 'set', set