mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
refactor: Remove u-prefix from strings
This commit is contained in:
@@ -92,16 +92,16 @@ def test_do_prompt_inputstrip():
|
||||
|
||||
def test_do_prompt_with_nonascii():
|
||||
answers = {
|
||||
'Q1': u'\u30c9\u30a4\u30c4',
|
||||
'Q1': '\u30c9\u30a4\u30c4',
|
||||
}
|
||||
qs.term_input = mock_input(answers)
|
||||
try:
|
||||
result = qs.do_prompt('Q1', default=u'\u65e5\u672c')
|
||||
result = qs.do_prompt('Q1', default='\u65e5\u672c')
|
||||
except UnicodeEncodeError:
|
||||
raise pytest.skip.Exception(
|
||||
'non-ASCII console input not supported on this encoding: %s',
|
||||
qs.TERM_ENCODING)
|
||||
assert result == u'\u30c9\u30a4\u30c4'
|
||||
assert result == '\u30c9\u30a4\u30c4'
|
||||
|
||||
|
||||
def test_quickstart_defaults(tempdir):
|
||||
@@ -145,8 +145,8 @@ def test_quickstart_all_answers(tempdir):
|
||||
'Root path': tempdir,
|
||||
'Separate source and build': 'y',
|
||||
'Name prefix for templates': '.',
|
||||
'Project name': u'STASI™'.encode(),
|
||||
'Author name': u'Wolfgang Schäuble & G\'Beckstein'.encode(),
|
||||
'Project name': 'STASI™'.encode(),
|
||||
'Author name': 'Wolfgang Schäuble & G\'Beckstein'.encode(),
|
||||
'Project version': '2.0',
|
||||
'Project release': '2.0.1',
|
||||
'Project language': 'de',
|
||||
@@ -182,16 +182,16 @@ def test_quickstart_all_answers(tempdir):
|
||||
assert ns['templates_path'] == ['.templates']
|
||||
assert ns['source_suffix'] == '.txt'
|
||||
assert ns['master_doc'] == 'contents'
|
||||
assert ns['project'] == u'STASI™'
|
||||
assert ns['copyright'] == u'%s, Wolfgang Schäuble & G\'Beckstein' % \
|
||||
assert ns['project'] == 'STASI™'
|
||||
assert ns['copyright'] == '%s, Wolfgang Schäuble & G\'Beckstein' % \
|
||||
time.strftime('%Y')
|
||||
assert ns['version'] == '2.0'
|
||||
assert ns['release'] == '2.0.1'
|
||||
assert ns['todo_include_todos'] is True
|
||||
assert ns['html_static_path'] == ['.static']
|
||||
assert ns['latex_documents'] == [
|
||||
('contents', 'STASI.tex', u'STASI™ Documentation',
|
||||
u'Wolfgang Schäuble \\& G\'Beckstein', 'manual')]
|
||||
('contents', 'STASI.tex', 'STASI™ Documentation',
|
||||
'Wolfgang Schäuble \\& G\'Beckstein', 'manual')]
|
||||
|
||||
assert (tempdir / 'build').isdir()
|
||||
assert (tempdir / 'source' / '.static').isdir()
|
||||
@@ -222,7 +222,7 @@ def test_generated_files_eol(tempdir):
|
||||
def test_quickstart_and_build(tempdir):
|
||||
answers = {
|
||||
'Root path': tempdir,
|
||||
'Project name': u'Fullwidth characters: \u30c9\u30a4\u30c4',
|
||||
'Project name': 'Fullwidth characters: \u30c9\u30a4\u30c4',
|
||||
'Author name': 'Georg Brandl',
|
||||
'Project version': '0.1',
|
||||
}
|
||||
@@ -247,7 +247,7 @@ def test_quickstart_and_build(tempdir):
|
||||
def test_default_filename(tempdir):
|
||||
answers = {
|
||||
'Root path': tempdir,
|
||||
'Project name': u'\u30c9\u30a4\u30c4', # Fullwidth characters only
|
||||
'Project name': '\u30c9\u30a4\u30c4', # Fullwidth characters only
|
||||
'Author name': 'Georg Brandl',
|
||||
'Project version': '0.1',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user