From 761b292e372ecc705023667fb72312c1b4396d6e Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 29 Jul 2010 20:26:04 +0200 Subject: [PATCH] Added skype: to list of recognized but ignored URL schemes. --- doc/changelog.txt | 2 ++ linkcheck/checker/unknownurl.py | 1 + tests/checker/test_unknown.py | 36 +++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 tests/checker/test_unknown.py diff --git a/doc/changelog.txt b/doc/changelog.txt index d66c6bd7..c0cd5203 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -20,6 +20,8 @@ Changes: - checking: Remove the unnormed URL warning. URLs can be written in more than one way and there is no norm. Closes: SF bug #1575800 +- checking: Add "skype:" to list of ignored URL schemes. + Closes: SF bug #2989086 Features: - ftp: Detect and support UTF-8 filename encoding capability of FTP diff --git a/linkcheck/checker/unknownurl.py b/linkcheck/checker/unknownurl.py index 9a18e018..77745d4a 100644 --- a/linkcheck/checker/unknownurl.py +++ b/linkcheck/checker/unknownurl.py @@ -58,6 +58,7 @@ acap # application configuration access protocol |javascript # JavaScript |gopher # Gopher |isbn # ISBN (int. book numbers) +|skype # Skype ):""" ignored_schemes_re = re.compile(ignored_schemes, re.VERBOSE) diff --git a/tests/checker/test_unknown.py b/tests/checker/test_unknown.py new file mode 100644 index 00000000..804409a9 --- /dev/null +++ b/tests/checker/test_unknown.py @@ -0,0 +1,36 @@ +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2010 Bastian Kleineidam +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +""" +Test checking of unknown URLs. +""" +from . import LinkCheckTest + + +class TestUnknown (LinkCheckTest): + """Test unknown URL scheme checking.""" + + def test_skype (self): + url = u"skype:" + nurl = self.norm(url) + resultlines = [ + u"url %s" % url, + u"cache key %s" % nurl, + u"real url %s" % nurl, + u"warning Skype URL ignored.", + u"valid", + ] + self.direct(url, resultlines)