Don't pass null authentication information to ENCODED.
authorDiane Trout <diane@ghic.org>
Tue, 13 Jan 2015 19:45:23 +0000 (11:45 -0800)
committerDiane Trout <diane@ghic.org>
Tue, 13 Jan 2015 19:45:23 +0000 (11:45 -0800)
the recent build seems unhappy getting auth=(None, None)
and while I was in there, update the domain name.

htsworkflow/submission/encoded.py
htsworkflow/submission/test/test_encoded.py

index 2dbdc4bb89d44fe85bd0c3b144b21080c4559739..951c28b2463be9d7bd68e6c2b02b58e2d1c3eac1 100644 (file)
@@ -196,7 +196,12 @@ class ENCODED:
         # do the request
 
         LOGGER.debug('username: %s, password: %s', self.username, self.password)
-        response = requests.get(url, auth=self.auth, headers=self.json_headers, params=kwargs)
+        arguments = {}
+        if self.username and self.password:
+            arguments['auth'] = self.auth
+        response = requests.get(url, headers=self.json_headers,
+                                params=kwargs,
+                                **arguments)
         if not response.status_code == requests.codes.ok:
             LOGGER.error("Error http status: {}".format(response.status_code))
             response.raise_for_status()
index 7216a7d85f022fe1cb63851d02ec6147ced72a48..336424c1aa762360fd0cc16512229a887df2ffb4 100644 (file)
@@ -56,7 +56,7 @@ class TestEncoded(TestCase):
                u'submitted_by': u'/users/0e3dde9b-aaf9-42dd-87f7-975a85072ed2/',
                u'treatments': [],
                u'uuid': u'42c46028-708f-4347-a3df-2c82dfb021c4'}
-        encode = ENCODED('submit.encodedcc.org')
+        encode = ENCODED('www.encodeproject.org')
         encode.schemas[u'library'] = schema
         encode.validate(obj)
         self.assertTrue('@id' in obj)