summaryrefslogtreecommitdiff
path: root/tests/test_build_applehelp.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-01-26 13:38:42 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2019-02-06 00:44:37 +0900
commitc4397318d3db4a2db729e98a27666251a1e4b973 (patch)
treebbfbaf2ea1614bd574d6f958ffbba238c6fae2db /tests/test_build_applehelp.py
parent6fd191d52ebe1a8940934875d5e884e6c93c7522 (diff)
downloadsphinx-git-c4397318d3db4a2db729e98a27666251a1e4b973.tar.gz
Separate applehelp to sphinxcontrib package
Diffstat (limited to 'tests/test_build_applehelp.py')
-rw-r--r--tests/test_build_applehelp.py54
1 files changed, 0 insertions, 54 deletions
diff --git a/tests/test_build_applehelp.py b/tests/test_build_applehelp.py
deleted file mode 100644
index b92ac8759..000000000
--- a/tests/test_build_applehelp.py
+++ /dev/null
@@ -1,54 +0,0 @@
-"""
- test_build_applehelp
- ~~~~~~~~~~~~~~~~~~~~
-
- Test the Apple Help builder and check its output. We don't need to
- test the HTML itself; that's already handled by
- :file:`test_build_html.py`.
-
- :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-import plistlib
-
-import pytest
-
-from sphinx.testing.path import path
-
-
-def check_structure(outdir):
- contentsdir = outdir / 'Contents'
- assert contentsdir.isdir()
- assert (contentsdir / 'Info.plist').isfile()
-
- with open(contentsdir / 'Info.plist', 'rb') as f:
- plist = plistlib.load(f)
- assert plist
- assert len(plist)
- assert plist.get('CFBundleIdentifier', None) == 'org.sphinx-doc.Sphinx.help'
-
- assert (contentsdir / 'Resources').isdir()
- assert (contentsdir / 'Resources' / 'en.lproj').isdir()
-
-
-def check_localization(outdir):
- lprojdir = outdir / 'Contents' / 'Resources' / 'en.lproj'
- assert (lprojdir / 'localized.txt').isfile()
-
-
-@pytest.mark.sphinx(
- 'applehelp', testroot='basic', srcdir='applehelp_output',
- confoverrides={'applehelp_bundle_id': 'org.sphinx-doc.Sphinx.help',
- 'applehelp_disable_external_tools': True})
-def test_applehelp_output(app, status, warning):
- (app.srcdir / 'en.lproj').makedirs()
- (app.srcdir / 'en.lproj' / 'localized.txt').write_text('')
- app.builder.build_all()
-
- # Have to use bundle_path, not outdir, because we alter the latter
- # to point to the lproj directory so that the HTML arrives in the
- # correct location.
- bundle_path = path(app.builder.bundle_path)
- check_structure(bundle_path)
- check_localization(bundle_path)