1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 23:48:47 +00:00

clean up test code

This commit is contained in:
Chilledheart
2014-08-27 17:13:05 +08:00
committed by lins05
parent a882caec03
commit 3044d2de20
6 changed files with 25 additions and 50 deletions

View File

@@ -1,22 +1,22 @@
import integration as common
from integration import HOME_URL, LOGOUT_URL, get_logged_instance
import unittest
class LoginTestCase(unittest.TestCase):
def setUp(self):
self.browser = common.getLoggedInstance()
self.browser = get_logged_instance()
self.assertIsNotNone(self.browser)
self.addCleanup(self.browser.quit)
def testLogin(self):
self.assertRegexpMatches(self.browser.current_url, common.HOME_URL)
self.assertRegexpMatches(self.browser.current_url, HOME_URL)
def testLogout(self):
myinfo_bar = self.browser.find_element_by_css_selector('#my-info')
logout_input = self.browser.find_element_by_css_selector('a#logout')
myinfo_bar.click()
logout_input.click()
self.assertRegexpMatches(self.browser.current_url, common.LOGOUT_URL)
self.assertRegexpMatches(self.browser.current_url, LOGOUT_URL)
if __name__ == '__main__':
unittest.main(verbosity=2)