diff --git a/mutalyzer/config.py b/mutalyzer/config.py index baa40b4fb84fba92eb4bef5ee627c1182599f630..339ec46e6c807b0340ae134298d22f52b8d7b5f3 100644 --- a/mutalyzer/config.py +++ b/mutalyzer/config.py @@ -138,14 +138,37 @@ class Config(): # We don't remove these after the tests, since they might be # useful for debugging. if mutalyzer.is_test(): - handle, filename = tempfile.mkstemp(suffix='.log', - prefix='mutalyzer-tests-') - os.close(handle) - self.Output.log = filename - dirname = tempfile.mkdtemp(suffix='.cache', - prefix='mutalyzer-tests-') - self.Retriever.cache = dirname - self.Scheduler.resultsDir = dirname + # Todo: + # + # This needs some refactoring. The problem with the temporary + # file and dir names is that they will not be used by the + # (running) batch daemon, which will thus save its results to + # to 'normal' directory. + # Furthermore, subsequent web requests from a unit test will + # use different configuration instantiations, so might not + # see results from previous requests. + # + # We need a more robust solution for different configurations, + # depending of the running user/setting (e.g. unit tests). + # + # Idea: Don't create a local instance of the website in the + # unit tests, but only use running instances of all servers + # (website, webservice, batch daemon). They will use their + # own 'normal' configuration. + # All other parts of the unit tests will use temporary test + # configuration values. We might even decorate the tests + # needing server access as such and provide the option of + # skipping these. + + #handle, filename = tempfile.mkstemp(suffix='.log', + # prefix='mutalyzer-tests-') + #os.close(handle) + #self.Output.log = filename + #dirname = tempfile.mkdtemp(suffix='.cache', + # prefix='mutalyzer-tests-') + #self.Retriever.cache = dirname + #self.Scheduler.resultsDir = dirname + pass except KeyError as e: raise ConfigurationError('Missing configuration value: %s' % e) diff --git a/tests/test_website.py b/tests/test_website.py index ae3512be7e37a7b92a40800d2d17bc3b2a5f47a7..e740edd4de2f00dbf98d275c3fa38735b891c06e 100644 --- a/tests/test_website.py +++ b/tests/test_website.py @@ -15,6 +15,7 @@ I just installed webtest by 'easy_install webtest'. import os import re import time +import web from nose.tools import * from webtest import TestApp @@ -32,6 +33,7 @@ class TestWSGI(): """ Initialize test application. """ + web.config.debug = False application = website.app.wsgifunc() self.app = TestApp(application) @@ -448,6 +450,8 @@ facilisi.""" def test_batch_multicolumn(self): """ Submit the batch syntax checker with a multiple-colums input file. + + This by the way also tests for the correct order of batch results. """ variants = [('AB026906.1(SDHD):g.7872G>T', 'NM_003002.1:c.3_4insG'), ('NM_003002.1:c.3_4insG', 'AB026906.1(SDHD):g.7872G>T'),