mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-16 22:10:26 +00:00
Updated copyright year; fix nntp newsserver test
This commit is contained in:
parent
92f8911d88
commit
563b057a4d
22 changed files with 43 additions and 33 deletions
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2005-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2005-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
|
||||
|
|
@ -138,16 +138,26 @@ need_proxy = _need_func(has_proxy, "proxy")
|
|||
|
||||
|
||||
@memoized
|
||||
def has_newsserver ():
|
||||
def has_newsserver (server):
|
||||
try:
|
||||
import nntplib
|
||||
nntp = nntplib.NNTP(NNTP_SERVER, usenetrc=False)
|
||||
nntp = nntplib.NNTP(server, usenetrc=False)
|
||||
nntp.close()
|
||||
return True
|
||||
except:
|
||||
except StandardError:
|
||||
return False
|
||||
|
||||
need_newsserver = _need_func(has_newsserver, "newsserver")
|
||||
|
||||
def need_newsserver (server):
|
||||
"""Decorator skipping test if newsserver is not available."""
|
||||
def check_func (func):
|
||||
def newfunc (*args, **kwargs):
|
||||
if not has_newsserver(server):
|
||||
raise SkipTest("Newsserver `%s' is not available" % server)
|
||||
return func(*args, **kwargs)
|
||||
newfunc.func_name = func.func_name
|
||||
return newfunc
|
||||
return check_func
|
||||
|
||||
|
||||
@memoized
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2004-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2004-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2004-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2004-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2004-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2004-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2004-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2004-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2004-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2004-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2004-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2004-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2004-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2004-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
|
||||
|
|
@ -35,7 +35,7 @@ class TestNews (LinkCheckTest):
|
|||
def newstest (self, url, resultlines):
|
||||
self.direct(url, resultlines)
|
||||
|
||||
@need_newsserver
|
||||
@need_newsserver(NNTP_SERVER)
|
||||
def test_news_without_host (self):
|
||||
# news testing
|
||||
url = u"news:comp.os.linux.misc"
|
||||
|
|
@ -58,7 +58,7 @@ class TestNews (LinkCheckTest):
|
|||
]
|
||||
self.newstest(url, resultlines)
|
||||
|
||||
@need_newsserver
|
||||
@need_newsserver(NNTP_SERVER)
|
||||
def test_snews_with_group (self):
|
||||
url = u"snews:de.comp.os.unix.linux.misc"
|
||||
nurl = self.norm(url)
|
||||
|
|
@ -72,7 +72,7 @@ class TestNews (LinkCheckTest):
|
|||
]
|
||||
self.newstest(url, resultlines)
|
||||
|
||||
@need_newsserver
|
||||
@need_newsserver(NNTP_SERVER)
|
||||
def test_illegal_syntax (self):
|
||||
# illegal syntax
|
||||
url = u"news:§$%&/´`(§%"
|
||||
|
|
@ -87,7 +87,7 @@ class TestNews (LinkCheckTest):
|
|||
]
|
||||
self.newstest(url, resultlines)
|
||||
|
||||
@need_newsserver
|
||||
@need_newsserver(NNTP_SERVER)
|
||||
@limit_time(NNTP_TIMEOUT_SECS, skip=True)
|
||||
def test_nntp_with_host (self):
|
||||
url = u"nntp://%s/comp.lang.python" % NNTP_SERVER
|
||||
|
|
@ -101,7 +101,7 @@ class TestNews (LinkCheckTest):
|
|||
]
|
||||
self.newstest(url, resultlines)
|
||||
|
||||
@need_newsserver
|
||||
@need_newsserver(NNTP_SERVER)
|
||||
@limit_time(NNTP_TIMEOUT_SECS, skip=True)
|
||||
def test_article_span (self):
|
||||
url = u"nntp://%s/comp.lang.python/1-5" % NNTP_SERVER
|
||||
|
|
@ -115,7 +115,7 @@ class TestNews (LinkCheckTest):
|
|||
]
|
||||
self.newstest(url, resultlines)
|
||||
|
||||
@need_newsserver
|
||||
@need_newsserver(NNTP_SERVER)
|
||||
def test_article_span_no_host (self):
|
||||
url = u"news:comp.lang.python/1-5"
|
||||
resultlines = [
|
||||
|
|
@ -127,7 +127,7 @@ class TestNews (LinkCheckTest):
|
|||
]
|
||||
self.newstest(url, resultlines)
|
||||
|
||||
@need_newsserver
|
||||
@need_newsserver(NNTP_SERVER)
|
||||
@limit_time(NNTP_TIMEOUT_SECS, skip=True)
|
||||
def test_host_no_group (self):
|
||||
url = u"nntp://%s/" % NNTP_SERVER
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2006-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2006-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2004-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2004-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2005-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2005-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2005-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2005-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2004-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2004-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2009 Bastian Kleineidam
|
||||
# Copyright (C) 2009-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2008-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2008-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2004-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2004-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
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2005 Joe Wreschnig
|
||||
# Copyright (C) 2005-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2005-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2004-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2004-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2006-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2006-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2004-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2004-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2004-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2004-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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
# Copyright (C) 2004-2009 Bastian Kleineidam
|
||||
# Copyright (C) 2004-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
|
||||
|
|
|
|||
Loading…
Reference in a new issue