changeset 716:cc620fb0ee60 0.6.x

0.6dev: Merging [792:793] from trunk.
author osimons
date Wed, 25 Nov 2009 08:16:52 +0000
parents 75d53795bf8c
children 4d85133f6c23
files bitten/htdocs/bitten.css bitten/master.py bitten/slave.py bitten/tests/master.py
diffstat 4 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/htdocs/bitten.css
+++ b/bitten/htdocs/bitten.css
@@ -163,15 +163,15 @@
 /* collapsible failure details */
 #content.build table.tests tr th p { margin: 0; padding: 0; text-align: left; }
 #content.build table.tests tr th p.details {
-  margin: 0; padding-left: 32px; padding-top: 5px; text-align: left; font-weight: normal;
+  margin: 0; padding-left: 4px; padding-top: 5px; text-align: left; font-weight: normal;
 }
 #content.build table.tests tr th p.details span {
   white-space: pre; font-family: monospace; font-weight: normal; font-size: smaller;
   color: #666;
 }
-#content.build table.tests .fixture { display: inline; }
+#content.build table.tests .fixture { display: inline-block; }
 #content.build table.tests tr.failed th .fixture a { 
-  background: url(../common/expanded.png) 0 50% no-repeat; padding-left: 16px;
+  background: url(../common/expanded.png) 50% 50% no-repeat; padding-left: 16px;
 }
 #content.build table.tests tr.failed th.collapsed .fixture a {
   background-image: url(../common/collapsed.png);
--- a/bitten/master.py
+++ b/bitten/master.py
@@ -99,8 +99,8 @@
 
         if 'id' not in req.args:
             if req.method != 'POST':
-                self._send_error(req, HTTP_METHOD_NOT_ALLOWED,
-                                      'Only POST allowed for build creation')
+                self._send_response(req,
+                                body='Only POST allowed for build creation.')
             return self._process_build_creation(req, slave_token)
 
         build = Build.fetch(self.env, req.args['id'])
--- a/bitten/slave.py
+++ b/bitten/slave.py
@@ -192,10 +192,12 @@
             try:
                 try:
                     if self.username and not self.auth_map.get(url):
+                        login_url = '%s/login?referer=%s' % (url[:-7],
+                                                        urllib.quote_plus(url))
                         # First request to url, authentication needed
                         if self.form_auth:
                             log.debug('Performing http form authentication')
-                            resp = self.request('POST', url[:-7] + '/login')
+                            resp = self.request('POST', login_url)
                             match = FORM_TOKEN_RE.search(resp.read())
                             if not match:
                                 log.error("Project %s does not support form "
@@ -207,11 +209,11 @@
                                                                 None, url)[1],
                                       'referer': '',
                                       '__FORM_TOKEN': match.group(1)} 
-                            self.request('POST', url[:-7] + '/login',
+                            self.request('POST', login_url,
                                          body=urllib.urlencode(values))
                         else:
                             log.debug('Performing basic/digest authentication')
-                            self.request('HEAD', url[:-7] + '/login')
+                            self.request('HEAD', login_url)
                         self.auth_map[url] = True
                     elif self.username:
                         log.debug('Reusing authentication information.')
--- a/bitten/tests/master.py
+++ b/bitten/tests/master.py
@@ -144,8 +144,8 @@
 
         self.assertRaises(RequestDone, module.process_request, req)
 
-        self.assertEquals(405, outheaders['Status'])
-        self.assertEquals('Only POST allowed for build creation',
+        self.assertEquals(200, outheaders['Status'])
+        self.assertEquals('Only POST allowed for build creation.',
                     outbody.getvalue())
 
     def test_create_build_no_match(self):
Copyright (C) 2012-2017 Edgewall Software