mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Deprecate `md5 and sha1 wrappers in sphinx.util` (#11512)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""Test the HTML builder and check output against XPath."""
|
||||
|
||||
import hashlib
|
||||
import os
|
||||
import re
|
||||
from itertools import chain, cycle
|
||||
@@ -12,7 +13,6 @@ from html5lib import HTMLParser
|
||||
from sphinx.builders.html import validate_html_extra_path, validate_html_static_path
|
||||
from sphinx.errors import ConfigError
|
||||
from sphinx.testing.util import strip_escseq
|
||||
from sphinx.util import md5
|
||||
from sphinx.util.inventory import InventoryFile
|
||||
|
||||
FIGURE_CAPTION = ".//figure/figcaption/p"
|
||||
@@ -474,9 +474,9 @@ def test_html_download(app):
|
||||
@pytest.mark.sphinx('html', testroot='roles-download')
|
||||
def test_html_download_role(app, status, warning):
|
||||
app.build()
|
||||
digest = md5(b'dummy.dat').hexdigest()
|
||||
digest = hashlib.md5(b'dummy.dat', usedforsecurity=False).hexdigest()
|
||||
assert (app.outdir / '_downloads' / digest / 'dummy.dat').exists()
|
||||
digest_another = md5(b'another/dummy.dat').hexdigest()
|
||||
digest_another = hashlib.md5(b'another/dummy.dat', usedforsecurity=False).hexdigest()
|
||||
assert (app.outdir / '_downloads' / digest_another / 'dummy.dat').exists()
|
||||
|
||||
content = (app.outdir / 'index.html').read_text(encoding='utf8')
|
||||
|
||||
Reference in New Issue
Block a user