diff options
author | shimizukawa <shimizukawa@gmail.com> | 2013-02-10 15:25:45 +0900 |
---|---|---|
committer | shimizukawa <shimizukawa@gmail.com> | 2013-02-10 15:25:45 +0900 |
commit | a24ce1a4bb568c7d23879cfc46677cc105b553f6 (patch) | |
tree | 0cddde06dd0410a72f5ed7ae3da6d52dfbc403b6 /tests/test_config.py | |
parent | da7ae91eaeeab430993f9e9dc20d93d5d4ed3975 (diff) | |
download | sphinx-a24ce1a4bb568c7d23879cfc46677cc105b553f6.tar.gz |
conf.py now accept CRLF end-of-line.
Diffstat (limited to 'tests/test_config.py')
-rw-r--r-- | tests/test_config.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index 69858a20..84a3b4b7 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -16,6 +16,7 @@ from util import * import sphinx from sphinx.config import Config from sphinx.errors import ExtensionError, ConfigError, VersionRequirementError +from sphinx.util.pycompat import b @with_app(confoverrides={'master_doc': 'master', 'nonexisting_value': 'True', @@ -113,3 +114,14 @@ def test_errors_warnings(dir): def test_needs_sphinx(): raises(VersionRequirementError, TestApp, confoverrides={'needs_sphinx': '9.9'}) + + +@with_tempdir +def test_config_eol(tmpdir): + # test config file's eol patterns: LF, CRLF + configfile = tmpdir / 'conf.py' + for eol in ('\n', '\r\n'): + configfile.write_bytes(b('project = "spam"' + eol)) + cfg = Config(tmpdir, 'conf.py', {}, None) + cfg.init_values() + assert cfg.project == u'spam' |