deluge/tests/test_client.py

28 lines
664 B
Python
Raw Normal View History

import tempfile
import os
import signal
2008-08-16 15:35:37 +00:00
import common
2008-08-16 15:35:37 +00:00
from twisted.trial import unittest
2008-08-16 15:35:37 +00:00
from deluge.ui.client import client
2008-08-16 15:35:37 +00:00
# Start a daemon to test with and wait a couple seconds to make sure it's started
2009-07-25 04:05:00 +00:00
config_directory = common.set_tmp_config_dir()
client.start_daemon(58847, config_directory)
import time
time.sleep(2)
2008-08-16 15:35:37 +00:00
class ClientTestCase(unittest.TestCase):
def test_connect_no_credentials(self):
d = client.connect("localhost", 58847)
d.addCallback(self.assertEquals, 10)
2008-08-16 15:35:37 +00:00
def on_connect(result):
self.addCleanup(client.disconnect)
return result
d.addCallback(on_connect)
return d