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:
Chris Mayo 2024-08-21 19:34:37 +01:00
parent 84b26b2da5
commit ecfd35b9e9
4 changed files with 66 additions and 2 deletions

View 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"
![img](http://urlimg.example.com)

View 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

View file

@ -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

View file

@ -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")