Browse Source

Properly handle test case where server doesn't start

tags/nilmdb-0.2
Jim Paris 11 years ago
parent
commit
b226dc4337
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      tests/test_nilmdb.py

+ 2
- 1
tests/test_nilmdb.py View File

@@ -113,7 +113,8 @@ class TestBlockingServer(object):
self.server.start(blocking = True, event = event)
thread = threading.Thread(target = run_server)
thread.start()
event.wait(timeout = 2)
if not event.wait(timeout = 10):
raise AssertionError("server didn't start in 10 seconds")

# Send request to exit.
req = urlopen("http://127.0.0.1:12380/exit/", timeout = 1)


Loading…
Cancel
Save