예제 #1
0
 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'
         ))