In some cases test_retrive_config will attempt to normalize None as a url
authorDiane Trout <diane@caltech.edu>
Thu, 8 Oct 2009 00:39:32 +0000 (00:39 +0000)
committerDiane Trout <diane@caltech.edu>
Thu, 8 Oct 2009 00:39:32 +0000 (00:39 +0000)
which doesn't work so well.

So this patch just returns the None and lets the problem
get sorted out elsewhere.

htsworkflow/util/url.py

index 1b62e58a55211d3436190458439b31108321508e..4e49c2dc4b41f63ac3ab199960225ee320a40408 100644 (file)
@@ -14,7 +14,12 @@ def normalize_url(url, scheme='http'):
     'http://foo.com/a/b/c/d/e/f.html'
     >>> normalize_url("foo.com", "https")
     'https://foo.com'
+    >>> normalize_url(None)
     """
+    # not much to do with None except avoid an exception
+    if url is None:
+        return None
+    
     scheme_sep = '://'
     if url.find(scheme_sep) != -1:
         return url