mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Resolve _StrPath warnings in the tests
This commit is contained in:
parent
9eff55711b
commit
dedb21e638
@ -41,11 +41,12 @@ def test_config_status(make_app, app_params):
|
|||||||
# incremental build (config entry changed)
|
# incremental build (config entry changed)
|
||||||
app3 = make_app(*args, confoverrides={'root_doc': 'indexx'}, **kwargs)
|
app3 = make_app(*args, confoverrides={'root_doc': 'indexx'}, **kwargs)
|
||||||
fname = app3.srcdir / 'index.rst'
|
fname = app3.srcdir / 'index.rst'
|
||||||
|
other_fname = app3.srcdir / 'indexx.rst'
|
||||||
assert fname.is_file()
|
assert fname.is_file()
|
||||||
shutil.move(fname, fname[:-4] + 'x.rst')
|
shutil.move(fname, other_fname)
|
||||||
assert app3.env.config_status == CONFIG_CHANGED
|
assert app3.env.config_status == CONFIG_CHANGED
|
||||||
app3.build()
|
app3.build()
|
||||||
shutil.move(fname[:-4] + 'x.rst', fname)
|
shutil.move(other_fname, fname)
|
||||||
output = strip_colors(app3.status.getvalue())
|
output = strip_colors(app3.status.getvalue())
|
||||||
assert 'The configuration has changed' in output
|
assert 'The configuration has changed' in output
|
||||||
assert "[config changed ('master_doc')] 1 added," in output
|
assert "[config changed ('master_doc')] 1 added," in output
|
||||||
|
@ -19,16 +19,16 @@ def test_catalog_info_for_file_and_path():
|
|||||||
cat = i18n.CatalogInfo('path', 'domain', 'utf-8')
|
cat = i18n.CatalogInfo('path', 'domain', 'utf-8')
|
||||||
assert cat.po_file == 'domain.po'
|
assert cat.po_file == 'domain.po'
|
||||||
assert cat.mo_file == 'domain.mo'
|
assert cat.mo_file == 'domain.mo'
|
||||||
assert cat.po_path == str(Path('path', 'domain.po'))
|
assert cat.po_path == Path('path', 'domain.po')
|
||||||
assert cat.mo_path == str(Path('path', 'domain.mo'))
|
assert cat.mo_path == Path('path', 'domain.mo')
|
||||||
|
|
||||||
|
|
||||||
def test_catalog_info_for_sub_domain_file_and_path():
|
def test_catalog_info_for_sub_domain_file_and_path():
|
||||||
cat = i18n.CatalogInfo('path', 'sub/domain', 'utf-8')
|
cat = i18n.CatalogInfo('path', 'sub/domain', 'utf-8')
|
||||||
assert cat.po_file == 'sub/domain.po'
|
assert cat.po_file == 'sub/domain.po'
|
||||||
assert cat.mo_file == 'sub/domain.mo'
|
assert cat.mo_file == 'sub/domain.mo'
|
||||||
assert cat.po_path == str(Path('path', 'sub', 'domain.po'))
|
assert cat.po_path == Path('path', 'sub', 'domain.po')
|
||||||
assert cat.mo_path == str(Path('path', 'sub', 'domain.mo'))
|
assert cat.mo_path == Path('path', 'sub', 'domain.mo')
|
||||||
|
|
||||||
|
|
||||||
def test_catalog_outdated(tmp_path):
|
def test_catalog_outdated(tmp_path):
|
||||||
@ -178,8 +178,8 @@ def test_CatalogRepository(tmp_path):
|
|||||||
# for language xx
|
# for language xx
|
||||||
repo = i18n.CatalogRepository(tmp_path, ['loc1', 'loc2'], 'xx', 'utf-8')
|
repo = i18n.CatalogRepository(tmp_path, ['loc1', 'loc2'], 'xx', 'utf-8')
|
||||||
assert list(repo.locale_dirs) == [
|
assert list(repo.locale_dirs) == [
|
||||||
str(tmp_path / 'loc1'),
|
tmp_path / 'loc1',
|
||||||
str(tmp_path / 'loc2'),
|
tmp_path / 'loc2',
|
||||||
]
|
]
|
||||||
assert all(isinstance(c, i18n.CatalogInfo) for c in repo.catalogs)
|
assert all(isinstance(c, i18n.CatalogInfo) for c in repo.catalogs)
|
||||||
assert sorted(c.domain for c in repo.catalogs) == [
|
assert sorted(c.domain for c in repo.catalogs) == [
|
||||||
|
Loading…
Reference in New Issue
Block a user