From 6a90c42ee5de75495186fb57e910f04ebc4a3839 Mon Sep 17 00:00:00 2001 From: Martijn Vermaat <martijn@vermaat.name> Date: Thu, 7 Jun 2012 10:15:37 +0000 Subject: [PATCH] Unit test for non-interactive links git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/trunk@548 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1 --- tests/test_website.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/tests/test_website.py b/tests/test_website.py index 7589230c..7451baa1 100644 --- a/tests/test_website.py +++ b/tests/test_website.py @@ -21,11 +21,12 @@ from nose.tools import * from webtest import TestApp import logging import urllib +import cgi import mutalyzer from mutalyzer import website -from mutalyzer.util import slow +from mutalyzer.util import slow, skip # TAL logs an awful lot of things with level=DEBUG. On any error, this is all @@ -243,6 +244,32 @@ class TestWSGI(): '<html>', '</html>') + def test_check_interactive_links(self): + """ + Submitting interactively should have links to transcripts also + interactive. + """ + r = self.app.get('/check?name=%s' % urllib.quote('NG_012337.1:g.7055C>T')) + r.mustcontain('0 Errors') + r.mustcontain('"check?name=%s"' % cgi.escape(urllib.quote('NG_012337.1:g.7055C>T'))) + r.mustcontain('"check?name=%s"' % cgi.escape(urllib.quote('NG_012337.1(TIMM8B_v001):c.-30-u2103G>A'))) + r.mustcontain('"check?name=%s"' % cgi.escape(urllib.quote('NG_012337.1(SDHD_v001):c.204C>T'))) + + @skip + def test_check_noninteractive_links(self): + """ + Submitting non-interactively should have links to transcripts also + non-interactive. + + Todo: This is hard to implement in TAL, do this when we move to + another template language. See Trac issue #97. + """ + r = self.app.get('/check?name=%s&standalone=1' % urllib.quote('NG_012337.1:g.7055C>T')) + r.mustcontain('0 Errors') + r.mustcontain('"check?name=%s&standalone=1"' % cgi.escape(urllib.quote('NG_012337.1:g.7055C>T'))) + r.mustcontain('"check?name=%s&standalone=1"' % cgi.escape(urllib.quote('NG_012337.1(TIMM8B_v001):c.-30-u2103G>A'))) + r.mustcontain('"check?name=%s&standalone=1"' % cgi.escape(urllib.quote('NG_012337.1(SDHD_v001):c.204C>T'))) + def test_check_noninteractive_old(self): """ Submit the name checker form non-interactively in the old style. -- GitLab