mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-16 22:10:26 +00:00
Fix TestFile.test_markdown on Python 3.12.5
mime type mapping for markdown was added. https://docs.python.org/3.12/whatsnew/changelog.html#id3
This commit is contained in:
parent
84b26b2da5
commit
ecfd35b9e9
4 changed files with 66 additions and 2 deletions
18
tests/checker/data/file-octet-stream.markdown
Normal file
18
tests/checker/data/file-octet-stream.markdown
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Test #
|
||||
|
||||
<http://url.example.com> text <http://url2.example.com>
|
||||
|
||||
[link]( http://urllink.example.com)
|
||||
|
||||
[link2](http://urllink2
|
||||
.example.com)
|
||||
|
||||
[test][id1]
|
||||
[URL][id2]
|
||||
|
||||
[id1]:
|
||||
http://urldef1.example.com
|
||||
|
||||
[id2]: http://urldef2.example.com "URL"
|
||||
|
||||

|
||||
42
tests/checker/data/file-octet-stream.markdown.result
Normal file
42
tests/checker/data/file-octet-stream.markdown.result
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
url file://%(curdir)s/%(datadir)s/file-octet-stream.markdown
|
||||
cache key file://%(curdir)s/%(datadir)s/file-octet-stream.markdown
|
||||
real url file://%(curdir)s/%(datadir)s/file-octet-stream.markdown
|
||||
name %(datadir)s/file-octet-stream.markdown
|
||||
warning The URL with content type 'application/octet-stream' is not parseable.
|
||||
valid
|
||||
|
||||
url http://url.example.com
|
||||
cache key http://url.example.com
|
||||
real url http://url.example.com
|
||||
error
|
||||
|
||||
url http://url2.example.com
|
||||
cache key http://url2.example.com
|
||||
real url http://url2.example.com
|
||||
error
|
||||
|
||||
url http://urldef1.example.com
|
||||
cache key http://urldef1.example.com
|
||||
real url http://urldef1.example.com
|
||||
error
|
||||
|
||||
url http://urldef2.example.com
|
||||
cache key http://urldef2.example.com
|
||||
real url http://urldef2.example.com
|
||||
error
|
||||
|
||||
url http://urllink.example.com
|
||||
cache key http://urllink.example.com
|
||||
real url http://urllink.example.com
|
||||
error
|
||||
|
||||
url http://urllink2.example.com
|
||||
cache key http://urllink2.example.com
|
||||
real url http://urllink2.example.com
|
||||
error
|
||||
|
||||
url http://urlimg.example.com
|
||||
cache key http://urlimg.example.com
|
||||
real url http://urlimg.example.com
|
||||
error
|
||||
|
||||
|
|
@ -2,7 +2,7 @@ url file://%(curdir)s/%(datadir)s/file.markdown
|
|||
cache key file://%(curdir)s/%(datadir)s/file.markdown
|
||||
real url file://%(curdir)s/%(datadir)s/file.markdown
|
||||
name %(datadir)s/file.markdown
|
||||
warning The URL with content type 'application/octet-stream' is not parseable.
|
||||
warning The URL with content type 'text/markdown' is not parseable.
|
||||
valid
|
||||
|
||||
url http://url.example.com
|
||||
|
|
|
|||
|
|
@ -87,7 +87,11 @@ class TestFile(LinkCheckTest):
|
|||
|
||||
def test_markdown(self):
|
||||
confargs = dict(enabledplugins=["MarkdownCheck"])
|
||||
self.file_test("file.markdown", confargs=confargs)
|
||||
if sys.version_info < (3, 12, 5):
|
||||
markdown_file = "file-octet-stream.markdown"
|
||||
else:
|
||||
markdown_file = "file.markdown"
|
||||
self.file_test(markdown_file, confargs=confargs)
|
||||
|
||||
def test_urllist(self):
|
||||
self.file_test("urllist.txt")
|
||||
|
|
|
|||
Loading…
Reference in a new issue