def test05(self): reader = WmsCapabilityReader({'proxyUrl': 'http://proxyhost.ac.uk:8080/'}) self.assertEqual(reader.makeProxiedUrl('https://datahost.ac.uk:8443/protected/data?find=abc&more=other#frag'), 'http://proxyhost.ac.uk:8080/https/datahost.ac.uk/8443/protected/data?find=abc&more=other#frag')
def test02(self): reader = WmsCapabilityReader({}) self.assertEqual(reader.makeProxiedUrl('http://datahost.ac.uk/'), 'http://datahost.ac.uk/')
def test04(self): reader = WmsCapabilityReader({'proxyUrl': 'http://proxyhost.ac.uk:8080/proxy/'}) self.assertEqual(reader.makeProxiedUrl('http://datahost.ac.uk/'), 'http://proxyhost.ac.uk:8080/proxy/http/datahost.ac.uk/-/')
def test01(self): reader = WmsCapabilityReader({'proxyUrl': None}) self.assertEqual(reader.makeProxiedUrl('http://datahost.ac.uk'), 'http://datahost.ac.uk')