コード例 #1
0
ファイル: helpers_tests.py プロジェクト: shank318/go-links
 def test__encode_ascii_incompatible_chars__many_query_params(self):
   self.assertEqual(
     'https://console.cloud.google.com/datastore/entities/query?project=great-project'
     '&organizationId=12321&ns=NS&kind=CoolKind&sortDir=DESCENDING&sortCol=created',
     helpers._encode_ascii_incompatible_chars(
       u'https://console.cloud.google.com/datastore/entities/query?project=great-project'
       u'&organizationId=12321&ns=NS&kind=CoolKind&sortDir=DESCENDING&sortCol=created'))
コード例 #2
0
 def test__encode_ascii_incompatible_chars__empty_string_parameter_value(
         self):
     self.assertEqual(
         'https://console.cloud.google.com/datastore/entities/query'
         '?project=great-project&ns=&organizationId=12321',
         helpers._encode_ascii_incompatible_chars(
             u'https://console.cloud.google.com/datastore/entities/query'
             u'?project=great-project&ns=&organizationId=12321'))
コード例 #3
0
 def test__encode_ascii_incompatible_chars__already_percent_encoded(self):
     self.assertEqual(
         'https://github.com/search?utf8=%E2%9C%93&q=party+parrot&type=',
         helpers._encode_ascii_incompatible_chars(
             u'https://github.com/search?utf8=%E2%9C%93&q=party+parrot&type='
         ))
コード例 #4
0
 def test__encode_ascii_incompatible_chars__url_has_fragment(self):
     self.assertEqual(
         'https://trot.to/?section=getting-to-shortlinks#/how-it-works',
         helpers._encode_ascii_incompatible_chars(
             u'https://trot.to/?section=getting-to-shortlinks#/how-it-works'
         ))