コード例 #1
0
ファイル: url_test.py プロジェクト: TheProjecter/snowforecast
  def testUrlToString(self):
    url = atom.url.Url(port=80)
    url.host = 'example.com'
    self.assertTrue(str(url), '//example.com:80')

    url = atom.url.Url(protocol='http', host='example.com', path='/feed')
    url.params['has spaces'] = 'sneaky=values?&!'
    self.assertTrue(url.to_string() == (
        'http://example.com/feed?has+spaces=sneaky%3Dvalues%3F%26%21'))
コード例 #2
0
  def testUrlToString(self):
    url = atom.url.Url(port=80)
    url.host = 'example.com'
    self.assert_(str(url), '//example.com:80')

    url = atom.url.Url(protocol='http', host='example.com', path='/feed')
    url.params['has spaces'] = 'sneaky=values?&!'
    self.assert_(url.to_string() == (
        'http://example.com/feed?has+spaces=sneaky%3Dvalues%3F%26%21'))
コード例 #3
0
ファイル: http.py プロジェクト: tomGdow/tomDowGAE
 def _get_access_url(self, url):
     proxy = os.environ.get('http_proxy')
     if url.protocol == 'http' and proxy:
         return url.to_string()
     else:
         return url.get_request_uri()
コード例 #4
0
ファイル: http.py プロジェクト: snosrap/gdatahealth
 def _get_access_url(self, url):
   return url.to_string()
コード例 #5
0
ファイル: http.py プロジェクト: BaljeetMalik/gridshore
 def _get_access_url(self, url):
   proxy = os.environ.get('http_proxy')
   if url.protocol == 'http' and proxy:
     return url.to_string()
   else:
     return url.get_request_uri()