コード例 #1
0
ファイル: test_utils.py プロジェクト: 2070616d/TP3
 def test_path_none(self):
     self.assertEqual(build_absolute_uri(self.host), self.host)
コード例 #2
0
ファイル: test_utils.py プロジェクト: ewianda/lscds-new-site
 def test_path_empty(self):
     expect(build_absolute_uri(self.host, '')).to.equal(self.host)
コード例 #3
0
ファイル: test_utils.py プロジェクト: 2070616d/TP3
 def test_absolute_uri(self):
     self.assertEqual(build_absolute_uri(self.host, '/foo/bar'),
                      'http://foobar.com/foo/bar')
コード例 #4
0
 def build_absolute_uri(self, path=None):
     # TODO: Quando a API diretamente (e não a partir de outro site) não tem
     # "referrer". Como resolver isso?
     return build_absolute_uri(
         flask.request.referrer, path).partition("&")[0]
コード例 #5
0
ファイル: tornado_strategy.py プロジェクト: 2070616d/TP3
 def build_absolute_uri(self, path=None):
     return build_absolute_uri('{0}://{1}'.format(self.request.protocol,
                                                  self.request.host),
                               path)
コード例 #6
0
ファイル: test_utils.py プロジェクト: lugnitdgp/avskr2.0
 def test_path_empty(self):
     self.assertEqual(build_absolute_uri(self.host, ''), self.host)
コード例 #7
0
ファイル: test_utils.py プロジェクト: lugnitdgp/avskr2.0
 def test_host_ends_with_slash_and_path_starts_with_slash(self):
     self.assertEqual(build_absolute_uri(self.host + '/', '/foo/bar'),
                      'http://foobar.com/foo/bar')
コード例 #8
0
 def test_path_https(self):
     expect(build_absolute_uri(self.host, 'https://barfoo.com')) \
           .to.equal('https://barfoo.com')
コード例 #9
0
 def test_host_ends_with_slash_and_path_starts_with_slash(self):
     expect(build_absolute_uri(self.host + '/', '/foo/bar')) \
           .to.equal('http://foobar.com/foo/bar')
コード例 #10
0
 def test_path_none(self):
     expect(build_absolute_uri(self.host)).to.equal(self.host)
コード例 #11
0
 def test_path_empty(self):
     expect(build_absolute_uri(self.host, '')).to.equal(self.host)
コード例 #12
0
ファイル: test_utils.py プロジェクト: ewianda/lscds-new-site
 def test_absolute_uri(self):
     expect(build_absolute_uri(self.host, '/foo/bar')) \
           .to.equal('http://foobar.com/foo/bar')
コード例 #13
0
ファイル: test_utils.py プロジェクト: ewianda/lscds-new-site
 def test_host_ends_with_slash_and_path_starts_with_slash(self):
     expect(build_absolute_uri(self.host + '/', '/foo/bar')) \
           .to.equal('http://foobar.com/foo/bar')
コード例 #14
0
ファイル: test_utils.py プロジェクト: ewianda/lscds-new-site
 def test_path_https(self):
     expect(build_absolute_uri(self.host, 'https://barfoo.com')) \
           .to.equal('https://barfoo.com')
コード例 #15
0
 def build_absolute_uri(self, path=None):
     return build_absolute_uri(
         '{0}://{1}'.format(self.request.protocol, self.request.host), path)
コード例 #16
0
 def test_absolute_uri(self):
     expect(build_absolute_uri(self.host, '/foo/bar')) \
           .to.equal('http://foobar.com/foo/bar')
コード例 #17
0
ファイル: test_utils.py プロジェクト: lugnitdgp/avskr2.0
 def test_path_none(self):
     self.assertEqual(build_absolute_uri(self.host), self.host)
コード例 #18
0
 def build_absolute_uri(self, path=None):
     return build_absolute_uri(request.host_url, path)
コード例 #19
0
ファイル: test_utils.py プロジェクト: lugnitdgp/avskr2.0
 def test_path_https(self):
     self.assertEqual(build_absolute_uri(self.host, 'https://barfoo.com'),
                      'https://barfoo.com')
コード例 #20
0
ファイル: test_utils.py プロジェクト: 2070616d/TP3
 def test_path_empty(self):
     self.assertEqual(build_absolute_uri(self.host, ''), self.host)
コード例 #21
0
ファイル: test_utils.py プロジェクト: lugnitdgp/avskr2.0
 def test_absolute_uri(self):
     self.assertEqual(build_absolute_uri(self.host, '/foo/bar'),
                      'http://foobar.com/foo/bar')
コード例 #22
0
ファイル: test_utils.py プロジェクト: 2070616d/TP3
 def test_path_https(self):
     self.assertEqual(build_absolute_uri(self.host, 'https://barfoo.com'),
                      'https://barfoo.com')
コード例 #23
0
 def build_absolute_uri(self, path=None):
     """Build absolute URI with given (optional) path"""
     return build_absolute_uri(self.request.host_url, path)
コード例 #24
0
ファイル: test_utils.py プロジェクト: 2070616d/TP3
 def test_host_ends_with_slash_and_path_starts_with_slash(self):
     self.assertEqual(build_absolute_uri(self.host + '/', '/foo/bar'),
                      'http://foobar.com/foo/bar')
コード例 #25
0
 def build_absolute_uri(self, path=None):
     """Build absolute URI with given (optional) path"""
     return build_absolute_uri(self.request.host_url, path)
コード例 #26
0
ファイル: test_utils.py プロジェクト: ewianda/lscds-new-site
 def test_path_none(self):
     expect(build_absolute_uri(self.host)).to.equal(self.host)