diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-08-11 13:58:21 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-08-11 13:58:21 +0900 |
| commit | bfcc2a159bc6786aad2c433c14437a0c4cc38ffa (patch) | |
| tree | 6f9c33b7ffe243f627d990033040873180a92b4e /tests | |
| parent | 82b451df03379ead0d7207dcf2a8cdb34dea3e47 (diff) | |
| download | sphinx-git-bfcc2a159bc6786aad2c433c14437a0c4cc38ffa.tar.gz | |
Fix test has broken in py3
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_ext_intersphinx.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_ext_intersphinx.py b/tests/test_ext_intersphinx.py index 6e6e23829..334d53971 100644 --- a/tests/test_ext_intersphinx.py +++ b/tests/test_ext_intersphinx.py @@ -87,16 +87,16 @@ def test_read_inventory_v2(): @mock.patch('sphinx.ext.intersphinx.read_inventory_v2') @mock.patch('sphinx.ext.intersphinx._read_from_url') def test_fetch_inventory_redirection(app, status, warning, _read_from_url, read_inventory_v2): - _read_from_url().readline.return_value = '# Sphinx inventory version 2' + _read_from_url().readline.return_value = '# Sphinx inventory version 2'.encode('utf-8') # same uri and inv, not redirected _read_from_url().geturl.return_value = 'http://hostname/' + INVENTORY_FILENAME fetch_inventory(app, 'http://hostname/', 'http://hostname/' + INVENTORY_FILENAME) assert 'intersphinx inventory has moved' not in status.getvalue() assert read_inventory_v2.call_args[0][1] == 'http://hostname/' - status.truncate(0) # same uri and inv, redirected + status.seek(0) status.truncate(0) _read_from_url().geturl.return_value = 'http://hostname/new/' + INVENTORY_FILENAME @@ -107,6 +107,7 @@ def test_fetch_inventory_redirection(app, status, warning, _read_from_url, read_ assert read_inventory_v2.call_args[0][1] == 'http://hostname/new' # different uri and inv, not redirected + status.seek(0) status.truncate(0) _read_from_url().geturl.return_value = 'http://hostname/new/' + INVENTORY_FILENAME @@ -115,6 +116,7 @@ def test_fetch_inventory_redirection(app, status, warning, _read_from_url, read_ assert read_inventory_v2.call_args[0][1] == 'http://hostname/' # different uri and inv, redirected + status.seek(0) status.truncate(0) _read_from_url().geturl.return_value = 'http://hostname/other/' + INVENTORY_FILENAME |
