mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-16 22:10:26 +00:00
Add an anchor test for multiple inter-connected files
This commit is contained in:
parent
c221afdab5
commit
5398fd2406
5 changed files with 127 additions and 0 deletions
10
tests/checker/data/anchor1.html
Normal file
10
tests/checker/data/anchor1.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<!-- targets -->
|
||||
<a name="oneone">one one</a>
|
||||
<a name="onetwo">one two</a>
|
||||
<a name="onethree">one three</a>
|
||||
<a name="onefour">one four</a>
|
||||
|
||||
<!-- links -->
|
||||
<a href="#oneone">anchor1 one from 1</a>
|
||||
<a href="anchor2.html#twotwo">anchor2 two from 1</a>
|
||||
<a href="anchor2.html#twothree">anchor2 three from 1</a>
|
||||
76
tests/checker/data/anchor1.html.result
Normal file
76
tests/checker/data/anchor1.html.result
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
url #twofour
|
||||
cache key file://%(curdir)s/%(datadir)s/anchor2.html#twofour
|
||||
real url file://%(curdir)s/%(datadir)s/anchor2.html#twofour
|
||||
name anchor2 four from 2
|
||||
valid
|
||||
|
||||
url #threefour
|
||||
cache key file://%(curdir)s/%(datadir)s/anchor3.html#threefour
|
||||
real url file://%(curdir)s/%(datadir)s/anchor3.html#threefour
|
||||
name anchor3 four from 3
|
||||
valid
|
||||
|
||||
url #oneone
|
||||
cache key file://%(curdir)s/%(datadir)s/anchor1.html#oneone
|
||||
real url file://%(curdir)s/%(datadir)s/anchor1.html#oneone
|
||||
name anchor1 one from 1
|
||||
valid
|
||||
|
||||
url #twoone
|
||||
cache key file://%(curdir)s/%(datadir)s/anchor2.html#twoone
|
||||
real url file://%(curdir)s/%(datadir)s/anchor2.html#twoone
|
||||
name anchor2 one from 2
|
||||
valid
|
||||
|
||||
url #threeone
|
||||
cache key file://%(curdir)s/%(datadir)s/anchor3.html#threeone
|
||||
real url file://%(curdir)s/%(datadir)s/anchor3.html#threeone
|
||||
name anchor3 one from 3
|
||||
valid
|
||||
|
||||
url anchor1.html#onefour
|
||||
cache key file://%(curdir)s/%(datadir)s/anchor1.html#onefour
|
||||
real url file://%(curdir)s/%(datadir)s/anchor1.html#onefour
|
||||
name anchor1 four from 3
|
||||
valid
|
||||
|
||||
url anchor1.html#onethree
|
||||
cache key file://%(curdir)s/%(datadir)s/anchor1.html#onethree
|
||||
real url file://%(curdir)s/%(datadir)s/anchor1.html#onethree
|
||||
name anchor1 three from 3
|
||||
valid
|
||||
|
||||
url anchor1.html#onetwo
|
||||
cache key file://%(curdir)s/%(datadir)s/anchor1.html#onetwo
|
||||
real url file://%(curdir)s/%(datadir)s/anchor1.html#onetwo
|
||||
name anchor1 two from 3
|
||||
valid
|
||||
|
||||
url anchor2.html#twothree
|
||||
cache key file://%(curdir)s/%(datadir)s/anchor2.html#twothree
|
||||
real url file://%(curdir)s/%(datadir)s/anchor2.html#twothree
|
||||
name anchor2 three from 1
|
||||
valid
|
||||
|
||||
url anchor2.html#twotwo
|
||||
cache key file://%(curdir)s/%(datadir)s/anchor2.html#twotwo
|
||||
real url file://%(curdir)s/%(datadir)s/anchor2.html#twotwo
|
||||
name anchor2 two from 1
|
||||
valid
|
||||
|
||||
url anchor3.html#threethree
|
||||
cache key file://%(curdir)s/%(datadir)s/anchor3.html#threethree
|
||||
real url file://%(curdir)s/%(datadir)s/anchor3.html#threethree
|
||||
name anchor3 three from 2
|
||||
valid
|
||||
|
||||
url anchor3.html#threetwo
|
||||
cache key file://%(curdir)s/%(datadir)s/anchor3.html#threetwo
|
||||
real url file://%(curdir)s/%(datadir)s/anchor3.html#threetwo
|
||||
name anchor3 two from 2
|
||||
valid
|
||||
|
||||
url file://%(curdir)s/%(datadir)s/anchor1.html
|
||||
cache key file://%(curdir)s/%(datadir)s/anchor1.html
|
||||
real url file://%(curdir)s/%(datadir)s/anchor1.html
|
||||
valid
|
||||
13
tests/checker/data/anchor2.html
Normal file
13
tests/checker/data/anchor2.html
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<!-- targets -->
|
||||
<a name="twoone">two one</a>
|
||||
<a name="twotwo">two two</a>
|
||||
<a name="twothree">two three</a>
|
||||
<a name="twofour">two four</a>
|
||||
|
||||
<-- links -->
|
||||
<a href="#twoone">anchor2 one from 2</a>
|
||||
<a href="anchor3.html#threetwo">anchor3 two from 2</a>
|
||||
<a href="anchor3.html#threethree">anchor3 three from 2</a>
|
||||
|
||||
<a href="#twofour">anchor2 four from 2</a>
|
||||
<a href="anchor1.html#oneone">anchor1 one from 2</a>
|
||||
13
tests/checker/data/anchor3.html
Normal file
13
tests/checker/data/anchor3.html
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<!-- targets -->
|
||||
<a name="threeone">three one</a>
|
||||
<a name="threetwo">three two</a>
|
||||
<a name="threethree">three three</a>
|
||||
<a name="threefour">three four</a>
|
||||
|
||||
<-- links -->
|
||||
<a href="#threeone">anchor3 one from 3</a>
|
||||
<a href="anchor1.html#onetwo">anchor1 two from 3</a>
|
||||
<a href="anchor1.html#onethree">anchor1 three from 3</a>
|
||||
|
||||
<a href="#threefour">anchor3 four from 3</a>
|
||||
<a href="anchor1.html#onefour">anchor1 four from 3</a>
|
||||
|
|
@ -49,3 +49,18 @@ class TestHttpAnchor(HttpServerTest):
|
|||
def test_anchor_html(self):
|
||||
confargs = dict(enabledplugins=["AnchorCheck"], recursionlevel=1)
|
||||
self.file_test("http_anchor.html", confargs=confargs)
|
||||
|
||||
|
||||
class TestAnchorsAcrossMultipleFiles(LinkCheckTest):
|
||||
"""Test anchors when there are multiple files"""
|
||||
|
||||
def test_anchor1_file(self):
|
||||
"""
|
||||
Test a network of files that reference each other, starting with anchor1.html
|
||||
"""
|
||||
filename = "anchor1.html"
|
||||
confargs = {"enabledplugins": ["AnchorCheck"]}
|
||||
url = "file://%(curdir)s/%(datadir)s/%(filename)s" % self.get_attrs(
|
||||
filename=filename)
|
||||
resultlines = self.get_resultlines(filename)
|
||||
self.direct(url, resultlines, recursionlevel=4, confargs=confargs)
|
||||
|
|
|
|||
Loading…
Reference in a new issue