labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1604803 - in /labs/panopticon/pan-utils: src/asf/data/releases.py tests/test_releases.py
Date Mon, 23 Jun 2014 13:51:01 GMT
Author: adc
Date: Mon Jun 23 13:51:01 2014
New Revision: 1604803

URL: http://svn.apache.org/r1604803
Log:
Some resource pages do not have full URLs in hrefs

Modified:
    labs/panopticon/pan-utils/src/asf/data/releases.py
    labs/panopticon/pan-utils/tests/test_releases.py

Modified: labs/panopticon/pan-utils/src/asf/data/releases.py
URL: http://svn.apache.org/viewvc/labs/panopticon/pan-utils/src/asf/data/releases.py?rev=1604803&r1=1604802&r2=1604803&view=diff
==============================================================================
--- labs/panopticon/pan-utils/src/asf/data/releases.py (original)
+++ labs/panopticon/pan-utils/src/asf/data/releases.py Mon Jun 23 13:51:01 2014
@@ -63,11 +63,12 @@ def scrape_release_url(release_url, igno
                 log.debug('ignored href %s in %s', href, scanning_url)
                 continue
 
+            full_href = urlparse.urljoin(scanning_url, href)
             if href.endswith('/'):
-                resources.update(_scrape(link.get('href')))
+                resources.update(_scrape(full_href))
             else:
                 text = link.get_text()
-                resources[href[original_len:-len(text) - 1]][text] = urlparse.urljoin(scanning_url,
href)
+                resources[full_href[original_len:-len(text) - 1].strip('/')][text] = full_href
 
         return resources
 

Modified: labs/panopticon/pan-utils/tests/test_releases.py
URL: http://svn.apache.org/viewvc/labs/panopticon/pan-utils/tests/test_releases.py?rev=1604803&r1=1604802&r2=1604803&view=diff
==============================================================================
--- labs/panopticon/pan-utils/tests/test_releases.py (original)
+++ labs/panopticon/pan-utils/tests/test_releases.py Mon Jun 23 13:51:01 2014
@@ -22,6 +22,9 @@ from asf.utils.test import ensure_gpg
 
 @ensure_gpg
 def test_scrape_release_url():
+    assert releases.verify_hashes('https://repository.apache.org/content/repositories/orgapachesirona-1000//',
'https://dist.apache.org/repos/dist/release/incubator/sirona/KEYS')
+    assert releases.verify_hashes('https://dist.apache.org/repos/dist/dev/incubator/sirona/0.2-incubating/',
'https://dist.apache.org/repos/dist/release/incubator/sirona/KEYS')
+
     assert releases.verify_hashes('https://repository.apache.org/content/repositories/orgapachemrql-1001/',
'http://www.apache.org/dist/incubator/mrql/KEYS')
     assert releases.verify_hashes('https://dist.apache.org/repos/dist/dev/incubator/mrql/0.9.2-incubating-RC2/',
'http://www.apache.org/dist/incubator/mrql/KEYS')
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message