[Tests] Fix test_ui_entry failure with libtorrent 1.1

- With libtorrent 1.1 dht is enabled from startup and the returned status
   contains DHT node values (i.e. non-zero). Should be sufficient to only test for start
   and end of the status string to be correct.
This commit is contained in:
Calum Lind 2016-11-27 15:05:08 +00:00
parent 0f2083db62
commit e7ce389e84
1 changed files with 1 additions and 14 deletions

View File

@ -347,20 +347,7 @@ class ConsoleUIWithDaemonBaseTestCase(UIWithDaemonBaseTestCase):
yield self.exec_command()
std_output = fd.out.getvalue()
status_output = """Total upload: 0.0 KiB/s
Total download: 0.0 KiB/s
DHT Nodes: 0
Total torrents: 0
Allocating: 0
Checking: 0
Downloading: 0
Seeding: 0
Paused: 0
Error: 0
Queued: 0
Moving: 0
"""
self.assertEqual(std_output, status_output)
self.assertTrue(std_output.startswith('Total upload: ') and std_output.endswith(' Moving: 0\n'))
class ConsoleScriptEntryWithDaemonTestCase(BaseTestCase, ConsoleUIWithDaemonBaseTestCase):