mirror of
https://github.com/logos-storage/deluge.git
synced 2026-07-25 20:43:17 +00:00
revert webui
This commit is contained in:
@@ -9,11 +9,7 @@ import cookielib, urllib2 , urllib
|
||||
import WebUi.webserver_common as ws
|
||||
import operator
|
||||
|
||||
|
||||
ws.init_05()
|
||||
print 'test-env=',ws.ENV
|
||||
|
||||
|
||||
|
||||
#CONFIG:
|
||||
BASE_URL = 'http://localhost:8112'
|
||||
@@ -41,7 +37,6 @@ class TestWebUiBase(unittest.TestCase):
|
||||
|
||||
def open_url(self, page, post=None):
|
||||
url = BASE_URL + page
|
||||
|
||||
if post == 1:
|
||||
post = {'Force_a_post' : 'spam'}
|
||||
if post:
|
||||
@@ -97,10 +92,6 @@ class TestWebUiBase(unittest.TestCase):
|
||||
else:
|
||||
pass
|
||||
|
||||
first_torrent_id = property(lambda self: ws.proxy.get_session_state()[0])
|
||||
first_torrent = property(lambda self: get_status(self.first_torrent_id))
|
||||
|
||||
|
||||
class TestNoAuth(TestWebUiBase):
|
||||
def test303(self):
|
||||
self.assert_303('/','/login')
|
||||
@@ -226,12 +217,8 @@ class TestIntegration(TestWebUiBase):
|
||||
|
||||
else:
|
||||
#test correctness of existing-list
|
||||
#The setup makes 0.6 fail everything, added an else..
|
||||
for url in self.urls:
|
||||
if ws.ENV.startswith('0.5'):
|
||||
self.assert_500('/torrent/add',{'url':url,'torrent':None})
|
||||
else:
|
||||
self.assert_303('/torrent/add','/index',{'url':url,'torrent':None})
|
||||
self.assert_500('/torrent/add',{'url':url,'torrent':None})
|
||||
|
||||
def testPauseResume(self):
|
||||
#pause all
|
||||
@@ -250,12 +237,12 @@ class TestIntegration(TestWebUiBase):
|
||||
#pause again.
|
||||
self.assert_303('/pause_all','/index', post=1)
|
||||
|
||||
torrent_id = self.first_torrent_id
|
||||
torrent_id = ws.proxy.get_session_state()[0]
|
||||
#single resume.
|
||||
self.assert_303('/torrent/start/%s' % torrent_id ,'/index', post=1)
|
||||
self.assert_303('/torrent/pause','/index', post={'start':torrent_id})
|
||||
self.assertEqual(get_status(torrent_id)["paused"] ,False)
|
||||
#single pause
|
||||
self.assert_303('/torrent/stop/%s' % torrent_id,'/index', post=1)
|
||||
self.assert_303('/torrent/pause','/index', post={'stop':torrent_id})
|
||||
self.assertEqual(get_status(torrent_id)["paused"] , True)
|
||||
|
||||
def testQueue(self):
|
||||
@@ -310,6 +297,8 @@ class TestIntegration(TestWebUiBase):
|
||||
#add torrrent-file
|
||||
#./test01.torrent
|
||||
|
||||
def testReannounce(self):
|
||||
pass
|
||||
|
||||
def test_do_redirect(self):
|
||||
self.assert_303('/home','/index')
|
||||
@@ -325,16 +314,17 @@ class TestIntegration(TestWebUiBase):
|
||||
assert self.cookies['order'] == 'up'
|
||||
#redir after pause-POST? in /index.
|
||||
self.assert_exists('/index?sort=name&order=down')
|
||||
torrent_id = self.first_torrent_id
|
||||
self.assert_303('/torrent/stop/%s' % torrent_id,
|
||||
'/index?sort=name&order=down', post=1)
|
||||
torrent_id = ws.proxy.get_session_state()[0]
|
||||
self.assert_303('/torrent/pause','/index?sort=name&order=down',
|
||||
post={'stop':torrent_id})
|
||||
#redir in details 1
|
||||
self.assert_303('/torrent/stop/%s?redir=/torrent/info/%s' %(torrent_id,torrent_id)
|
||||
,'/torrent/info/' + torrent_id, post = 1)
|
||||
self.assert_303('/torrent/pause?redir=/torrent/info/' + torrent_id
|
||||
,'/torrent/info/' + torrent_id, post = {'stop':torrent_id})
|
||||
#redir in details 2
|
||||
self.assert_303('/torrent/stop/%s' % torrent_id
|
||||
self.assert_303('/torrent/pause'
|
||||
,'/torrent/info/' + torrent_id ,
|
||||
post={'redir': '/torrent/info/' + torrent_id})
|
||||
post={'stop':torrent_id,
|
||||
'redir': '/torrent/info/' + torrent_id})
|
||||
|
||||
def testRemote(self):
|
||||
pass
|
||||
@@ -342,26 +332,6 @@ class TestIntegration(TestWebUiBase):
|
||||
def test_redir_after_login(self):
|
||||
pass
|
||||
|
||||
def testReannounce(self):
|
||||
torrent_id = self.first_torrent_id
|
||||
self.assert_303(
|
||||
'/torrent/reannounce/%(id)s?redir=/torrent/info/%(id)s'
|
||||
% {'id':torrent_id}
|
||||
,'/torrent/info/' + torrent_id, post = 1)
|
||||
|
||||
def testRecheck(self):
|
||||
#add test before writing code..
|
||||
#RELEASE-->disable
|
||||
"""
|
||||
torrent_id = self.first_torrent_id
|
||||
self.assert_303(
|
||||
'/torrent/recheck/%(id)s?redir=/torrent/info/%(id)s'
|
||||
% {'id':torrent_id}
|
||||
,'/torrent/info/' + torrent_id, post = 1)
|
||||
"""
|
||||
|
||||
|
||||
|
||||
#
|
||||
|
||||
if False:
|
||||
|
||||
Reference in New Issue
Block a user