mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-16 22:10:26 +00:00
commit
611bdd6c0a
8 changed files with 72 additions and 5 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -25,6 +25,7 @@ jobs:
|
|||
- "3.10"
|
||||
- "3.11"
|
||||
- "3.12"
|
||||
- "3.13"
|
||||
toxenv: [py]
|
||||
include:
|
||||
- python-version: "3.9"
|
||||
|
|
@ -79,6 +80,7 @@ jobs:
|
|||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "${{ matrix.python-version }}"
|
||||
allow-prereleases: true
|
||||
|
||||
- name: Pip cache
|
||||
uses: actions/cache@v4
|
||||
|
|
|
|||
|
|
@ -386,8 +386,8 @@ def get_user_config():
|
|||
)
|
||||
if not os.path.exists(userconf):
|
||||
# initial config (with all options explained)
|
||||
with importlib.resources.as_file(importlib.resources.files(
|
||||
f"{PACKAGE_NAME}.data").joinpath("linkcheckerrc")) as initialconf:
|
||||
with importlib.resources.path(
|
||||
f"{PACKAGE_NAME}.data", "linkcheckerrc") as initialconf:
|
||||
# copy the initial configuration to the user configuration
|
||||
try:
|
||||
make_userdir(userconf)
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ classifiers = [
|
|||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Programming Language :: Python :: 3.13",
|
||||
]
|
||||
|
||||
requires-python = ">=3.9"
|
||||
|
|
|
|||
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")
|
||||
|
|
|
|||
2
tox.ini
2
tox.ini
|
|
@ -1,5 +1,5 @@
|
|||
[tox]
|
||||
envlist = py3{9,10,11,12}, minreqs
|
||||
envlist = py3{9,10,11,12,13}, minreqs
|
||||
|
||||
[base]
|
||||
deps =
|
||||
|
|
|
|||
Loading…
Reference in a new issue