def test_check_connection_failed(self): import monitorrent.plugins.clients.utorrent with patch.object(monitorrent.plugins.clients.utorrent.requests.Session, 'get', side_effect=Exception): plugin = UTorrentClientPlugin() settings = {'host': self.bad_host, 'port': self.bad_port, 'username': self.bad_login, 'password': self.bad_password} plugin.set_settings(settings) self.assertFalse(plugin.check_connection())
def test_check_connection_successfull(self): plugin = UTorrentClientPlugin() settings = { 'host': self.real_host, 'port': self.real_port, 'username': self.real_login, 'password': self.real_password } plugin.set_settings(settings) self.assertTrue(plugin.check_connection())
def test_check_connection_successfull(self): plugin = UTorrentClientPlugin() settings = {'host': self.real_host, 'port': self.real_port, 'username': self.real_login, 'password': self.real_password} plugin.set_settings(settings) self.assertTrue(plugin.check_connection())