Exemple #1
0
 def test09_host_port_prefix(self):
     auth = IIIFAuth()
     self.assertEqual( auth.scheme_host_port_prefix('sc','x', '9', 'z'), 'sc://x:9/z' )
     self.assertEqual( auth.scheme_host_port_prefix(host='x', prefix='z'), 'http://x/z' )
     self.assertEqual( auth.scheme_host_port_prefix(host='yy'), 'http://yy' )
     self.assertEqual( auth.scheme_host_port_prefix(host='yy',port=80), 'http://yy' )
     self.assertEqual( auth.scheme_host_port_prefix(host='yy',port=81,prefix='x'), 'http://yy:81/x' )
     self.assertEqual( auth.scheme_host_port_prefix(scheme='https',host='z1',port=443), 'https://z1' )
     self.assertEqual( auth.scheme_host_port_prefix(scheme='https',host='z2',port=444), 'https://z2:444' )
Exemple #2
0
 def test08_scheme_host_port_prefix(self):
     """Test URI building with scheme_host_port_prefix."""
     auth = IIIFAuth()
     self.assertEqual(auth.scheme_host_port_prefix('sc', 'x', '9', 'z'),
                      'sc://x:9/z')
     self.assertEqual(auth.scheme_host_port_prefix(host='x', prefix='z'),
                      'http://x/z')
     self.assertEqual(auth.scheme_host_port_prefix(host='yy'), 'http://yy')
     self.assertEqual(auth.scheme_host_port_prefix(host='yy', port=80),
                      'http://yy')
     self.assertEqual(
         auth.scheme_host_port_prefix(host='yy', port=81, prefix='x'),
         'http://yy:81/x')
     self.assertEqual(
         auth.scheme_host_port_prefix(scheme='https', host='z1', port=443),
         'https://z1')
     self.assertEqual(
         auth.scheme_host_port_prefix(scheme='https', host='z2', port=444),
         'https://z2:444')