Skip to content
Snippets Groups Projects
Commit fd469a10 authored by Vermaat's avatar Vermaat
Browse files

Fixes for failing unit tests (disabled temporary config values).

parent 560c99ba
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment