Changeset 103
- Timestamp:
- 2009年08月23日 18时14分31秒 (2 years ago)
- Location:
- trunk/pysvnmanager/tests/functional
- Files:
-
- 5 modified
-
test_authz.py (modified) (12 diffs)
-
test_check.py (modified) (6 diffs)
-
test_login.py (modified) (2 diffs)
-
test_repos.py (modified) (2 diffs)
-
test_role.py (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pysvnmanager/tests/functional/test_authz.py
r102 r103 25 25 res = self.app.get(url_for(controller='authz')) 26 26 assert res.status == 302 27 self.assertEqual(res.header('location'), '/login')27 assert res.header('location').endswith('/login'), res.header('location') 28 28 29 29 # Login as common user … … 31 31 res = self.app.get(url_for(controller='authz')) 32 32 assert res.status == 302 33 self.assertEqual(res.header('location'), '/security/failed', res.header('location'))33 assert res.header('location').endswith('/security/failed'), res.header('location') 34 34 35 35 # Login as repos admin … … 51 51 res = self.app.get(url_for(controller='authz', action='init_repos_list')) 52 52 assert res.status == 302 53 self.assertEqual(res.header('location'), '/login')53 assert res.header('location').endswith('/login'), res.header('location') 54 54 55 55 # authz test … … 57 57 res = self.app.get(url_for(controller='authz', action='init_repos_list')) 58 58 assert res.status == 302, res.status 59 assert res.header('location') =='/security/failed', res.header('location')59 assert res.header('location').endswith('/security/failed'), res.header('location') 60 60 61 61 # Login as superuser … … 79 79 res = self.app.get(url_for(controller='authz', action='repos_changed')) 80 80 assert res.status == 302 81 self.assertEqual(res.header('location'), '/login')81 assert res.header('location').endswith('/login'), res.header('location') 82 82 83 83 # authz test … … 85 85 res = self.app.get(url_for(controller='authz', action='repos_changed')) 86 86 assert res.status == 302, res.status 87 assert res.header('location') =='/security/failed', res.header('location')87 assert res.header('location').endswith('/security/failed'), res.header('location') 88 88 89 89 # Login as superuser … … 120 120 res = self.app.get(url_for(controller='authz', action='path_changed')) 121 121 assert res.status == 302 122 self.assertEqual(res.header('location'), '/login')122 assert res.header('location').endswith('/login'), res.header('location') 123 123 124 124 # authz test … … 126 126 res = self.app.get(url_for(controller='authz', action='path_changed')) 127 127 assert res.status == 302, res.status 128 assert res.header('location') =='/security/failed', res.header('location')128 assert res.header('location').endswith('/security/failed'), res.header('location') 129 129 130 130 self.login('root') … … 166 166 res = self.app.get(url_for(controller='authz', action='save_authz')) 167 167 assert res.status == 302 168 self.assertEqual(res.header('location'), '/login')168 assert res.header('location').endswith('/login'), res.header('location') 169 169 170 170 # authz test … … 172 172 res = self.app.get(url_for(controller='authz', action='save_authz')) 173 173 assert res.status == 302, res.status 174 assert res.header('location') =='/security/failed', res.header('location')174 assert res.header('location').endswith('/security/failed'), res.header('location') 175 175 176 176 # Login as superuser … … 334 334 res = self.app.get(url_for(controller='authz', action='delete_authz')) 335 335 assert res.status == 302 336 assert res.header('location') == '/login', res.header('location')336 assert res.header('location').endswith('/login'), res.header('location') 337 337 338 338 # authz test … … 340 340 res = self.app.get(url_for(controller='authz', action='delete_authz')) 341 341 assert res.status == 302, res.status 342 assert res.header('location') =='/security/failed', res.header('location')342 assert res.header('location').endswith('/security/failed'), res.header('location') 343 343 344 344 authz = self.load_authz() -
trunk/pysvnmanager/tests/functional/test_check.py
r102 r103 26 26 res = self.app.get(url_for(controller='check')) 27 27 assert res.status == 302 28 self.assertEqual(res.header('location'), '/login')28 assert res.header('location').endswith('/login'), res.header('location') 29 29 30 30 # Login as common user … … 32 32 res = self.app.get(url_for(controller='check')) 33 33 assert res.status == 302, res.status 34 assert res.header('location') =='/security/failed', res.header('location')34 assert res.header('location').endswith('/security/failed'), res.header('location') 35 35 36 36 # Login as repos admin … … 56 56 res = self.app.get(url_for(controller='check', action='access_map')) 57 57 assert res.status == 302 58 self.assertEqual(res.header('location'), '/login')58 assert res.header('location').endswith('/login'), res.header('location') 59 59 60 60 # authz test … … 62 62 res = self.app.get(url_for(controller='check', action='access_map')) 63 63 assert res.status == 302, res.status 64 assert res.header('location') =='/security/failed', res.header('location')64 assert res.header('location').endswith('/security/failed'), res.header('location') 65 65 66 66 # Login as superuser … … 229 229 res = self.app.get(url_for(controller='check', action='get_auth_path')) 230 230 assert res.status == 302 231 assert res.header('location') == '/login', res.header('location')231 assert res.header('location').endswith('/login'), res.header('location') 232 232 233 233 # authz test … … 235 235 res = self.app.get(url_for(controller='check', action='get_auth_path')) 236 236 assert res.status == 302, res.status 237 assert res.header('location') =='/security/failed', res.header('location')237 assert res.header('location').endswith('/security/failed'), res.header('location') 238 238 239 239 self.login('root') -
trunk/pysvnmanager/tests/functional/test_login.py
r102 r103 31 31 res = self.app.get(url_for(controller='security', action='submit'), params) 32 32 self.assert_(res.status == 302) 33 self.assert_(res.all_headers('location') == ['/'] , res.all_headers('location'))33 self.assert_(res.all_headers('location') == ['/'] or res.all_headers('location') == ['http://localhost/'], res.all_headers('location')) 34 34 self.assert_(res.session['user'] == 'root', res.session) 35 35 … … 54 54 res = self.app.get(url_for(controller='security', action='logout')) 55 55 self.assert_(res.status == 302) 56 self.assert_(res.all_headers('location') == ['/login'] , res.all_headers('location'))56 self.assert_(res.all_headers('location') == ['/login'] or res.all_headers('location') == ['http://localhost/login'], res.all_headers('location')) 57 57 self.assert_(res.session.get('user') == None, res.session.get('user')) -
trunk/pysvnmanager/tests/functional/test_repos.py
r102 r103 26 26 res = self.app.get(url_for(controller='repos')) 27 27 assert res.status == 302 28 self.assertEqual(res.header('location'), '/login')28 assert res.header('location').endswith('/login'), res.header('location') 29 29 30 30 # Login as common user … … 32 32 res = self.app.get(url_for(controller='repos')) 33 33 assert res.status == 302, res.status 34 assert res.header('location') =='/security/failed', res.header('location')34 assert res.header('location').endswith('/security/failed'), res.header('location') 35 35 36 36 # repos admin can access repos controller(not root admin), but only with authed repos -
trunk/pysvnmanager/tests/functional/test_role.py
r102 r103 26 26 res = self.app.get(url_for(controller='role')) 27 27 assert res.status == 302 28 self.assertEqual(res.header('location'), '/login')28 assert res.header('location').endswith('/login'), res.header('location') 29 29 30 30 # Login as common user … … 32 32 res = self.app.get(url_for(controller='role')) 33 33 assert res.status == 302, res.status 34 assert res.header('location') =='/security/failed', res.header('location')34 assert res.header('location').endswith('/security/failed'), res.header('location') 35 35 36 36 # Repos admin(not root admin) can access role controller, but with disabled button. … … 53 53 res = self.app.get(url_for(controller='role', action='get_role_info')) 54 54 assert res.status == 302 55 self.assertEqual(res.header('location'), '/login')55 assert res.header('location').endswith('/login'), res.header('location') 56 56 57 57 # authz test … … 59 59 res = self.app.get(url_for(controller='role', action='get_role_info')) 60 60 assert res.status == 302, res.status 61 assert res.header('location') =='/security/failed', res.header('location')61 assert res.header('location').endswith('/security/failed'), res.header('location') 62 62 63 63 # Login as superuser … … 128 128 res = self.app.get(url_for(controller='role', action='save_group')) 129 129 assert res.status == 302 130 self.assertEqual(res.header('location'), '/login')130 assert res.header('location').endswith('/login'), res.header('location') 131 131 132 132 # authz test … … 134 134 res = self.app.get(url_for(controller='role', action='save_group')) 135 135 assert res.status == 302, res.status 136 assert res.header('location') =='/security/failed', res.header('location')136 assert res.header('location').endswith('/security/failed'), res.header('location') 137 137 138 138 … … 213 213 res = self.app.get(url_for(controller='role', action='delete_group')) 214 214 assert res.status == 302 215 self.assertEqual(res.header('location'), '/login')215 assert res.header('location').endswith('/login'), res.header('location') 216 216 217 217 # authz test … … 219 219 res = self.app.get(url_for(controller='role', action='delete_group')) 220 220 assert res.status == 302, res.status 221 assert res.header('location') =='/security/failed', res.header('location')221 assert res.header('location').endswith('/security/failed'), res.header('location') 222 222 223 223 # Delete group failed, ref by other group. … … 275 275 res = self.app.get(url_for(controller='role', action='save_alias')) 276 276 assert res.status == 302 277 self.assertEqual(res.header('location'), '/login')277 assert res.header('location').endswith('/login'), res.header('location') 278 278 279 279 # authz test … … 281 281 res = self.app.get(url_for(controller='role', action='save_alias')) 282 282 assert res.status == 302, res.status 283 assert res.header('location') =='/security/failed', res.header('location')283 assert res.header('location').endswith('/security/failed'), res.header('location') 284 284 285 285 # Change alias successfully … … 352 352 res = self.app.get(url_for(controller='role', action='delete_alias')) 353 353 assert res.status == 302 354 self.assertEqual(res.header('location'), '/login')354 assert res.header('location').endswith('/login'), res.header('location') 355 355 356 356 # authz test … … 358 358 res = self.app.get(url_for(controller='role', action='delete_alias')) 359 359 assert res.status == 302, res.status 360 assert res.header('location') =='/security/failed', res.header('location')360 assert res.header('location').endswith('/security/failed'), res.header('location') 361 361 362 362 # Delete alias successfully
![(please configure the [header_logo] section in trac.ini)](/trac/pysvnmanager/chrome/common/trac_banner.png)