Esempio n. 1
0
def setUpModule():
    if not hasattr(Shared,"settings") or not hasattr(Shared,"debug"): #not moduleSetUp: # 026 The condition doesn't work in pyDev coz global vars aren't loaded. 
        print "Setting up the module."
        settings=Settings()
        settings.pathStorage=UnixPathStorageMock()
        # settings.mainINIFilePath="/media/KINGSTON/Sumid/src/testing.ini" # 026 For future - testing could have other settings.
        # settings.loadAdaptive("all") # 026 Conflicts with args loaded by unittest.
        settings.loadAdaptive("INI","sumid")
        settings.workDir="/home/sumid.results/unittests/"
        settings.logDir="/home/sumid.results/unittests/"
        Shared.settings=settings
        debug=Debug(settings)
        Shared.debug=debug
Esempio n. 2
0
File: bow.py Progetto: xhujerr/Sumid
            debug.ThreadAwareLogger.debug(
                "There are still %i counters which are not in db yet. Fixing it." % (self.inputQueue.qsize())
            )
            semiProduct = self.consume()
            if self.verifySemiProduct(semiProduct):
                self.produce(semiProduct)


class AbstractFilter(Shared):
    _nonMatchRegexp = None
    _matchRegexp = None


# body begin
if __name__ == "__main__":
    settings = Settings()
    Shared.settings = settings
    settings.mainINIFilePath = mainINIFilePath
    settings.loadAdaptive("all")
    settings.loadFromINI(mainINIFilePath)
    debug = Debug(settings)
    Shared.debug = debug

    factory = FactoryMethod()
    settings.pathStorage = factory.create(eval(settings.platform + "PathStorage"))
    factory.sharedRef.pathStorage = settings.pathStorage

    files = FilesAdaptorComplex()
    settings.connectFilesAdaptor(files)
    linklistAdaptor = LinklistAdaptor()
    linklistAdaptor.connectLinklistFile(files.linklist)
Esempio n. 3
0
            parentNode.processedChildren.append(componentStub)
            if previousComponentStub:
                previousComponentStub.next=componentStub
            componentStub.previous=previousComponentStub
            componentStub.counters=CounterManager()
            componentStub.counters.increment("patternFound")
            componentStub.settings.previousRange=3
            componentStub.settings.maxTrialsPerTree=1000
            componentStub.settings.sibsLimit=50
            componentStub.status=404
            previousComponentStub=componentStub
        # Needed to add next to the last node:
        parentNode.processedChildren[-1].next=None
        # Status of all nodes is kept unsuccessful.
        # END: Creating artificial pseudo-tree as an input data.
        # Now I gonna take last child and try the sibs decision.
        testedNode=parentNode.processedChildren[-1]
        result=testedNode.sibsExtendDecision()
        self.assertEqual(False,result)
        
if __name__ == "__main__":

    settings=Settings()
    # settings.mainINIFilePath="/media/KINGSTON/Sumid/src/testing.ini" # 026 For future - testing could have other settings.
    settings.loadAdaptive("all")
    Shared.settings=settings
    debug=Debug(settings)
    Shared.debug=debug

    unittest.main()