def test_yadis(self): # testing the yadis page headers = {'Accept': 'application/xrds+xml'} res = self.app.get('/' + test_config.get('auth.user'), headers=headers) self.assertEqual(res.content_type, 'application/xrds+xml') # regular html page res = self.app.get('/' + test_config.get('auth.user')) self.assertEqual(res.content_type, 'text/html')
def setUp(self): config = {'auth.backend': 'dummy', 'oidstorage.backend': 'memory', 'oid.host': 'http://localhost', 'oid.assoc_expires_in': 3600} user = test_config.get('auth.credentials').encode('base64') self.auth = {'HTTP_AUTHORIZATION': 'Basic ' + user} self.app = TestApp(make_app(config))
def setUp(self): config = { 'auth.backend': 'services.auth.dummy.DummyAuth', 'oidstorage.backend': 'oidserver.storage._redis.RedisStorage', #oid.host': 'http://localhost', 'oidstorage.host': 'id1.dev.mtv1.svc.mozilla.com', 'oidstorage.port': 6379} user = test_config.get('auth.credentials').encode('base64') self.auth = {'HTTP_AUTHORIZATION': 'Basic ' + user} self.app = TestApp(make_app(config))
# use your version of this file under the terms of the MPL, indicate your # decision by deleting the provisions above and replace them with the notice # and other provisions required by the GPL or the LGPL. If you do not delete # the provisions above, a recipient may use your version of this file under # the terms of any one of the MPL, the GPL or the LGPL. # # ***** END LICENSE BLOCK ***** import unittest from webtest import TestApp from oidserver.wsgiapp import make_app from oidserver.tests import test_config REDIS = False try: if 'redis' in test_config.get('oidstorage.backend','memory'): REDIS = True except ImportError: pass if REDIS: class TestRedis(unittest.TestCase): bad_credentials = {'email': '*****@*****.**', 'password': '******'} # Please use valid credentials and targets good_credentials = {'email': '*****@*****.**', 'password': '******'}
# decision by deleting the provisions above and replace them with the notice # and other provisions required by the GPL or the LGPL. If you do not delete # the provisions above, a recipient may use your version of this file under # the terms of any one of the MPL, the GPL or the LGPL. # # ***** END LICENSE BLOCK ***** import unittest from webtest import TestApp from oidserver.wsgiapp import make_app from oidserver.tests import test_config from oidserver.tests import FakeRequest MONGO = False try: if test_config.get('oidstorage.backend','memory') == 'mongo': MONGO = True except ImportError: pass if MONGO: class TestMongo(unittest.TestCase): bad_credentials = {'email': '*****@*****.**', 'password': '******'} # Please use valid credentials and targets good_credentials = {'email': '*****@*****.**', 'password': '******'}