Esempio n. 1
0
 def update_cookies_list(self, cookies_store):
     cookies_store.clear()
     # key, active, site, value
     for key in self.cookies.keys():
         cookies_store.append([key, self.cookies[key]["active"],
                               self.cookies[key]["site"],
                               encode_cookie_values(self.cookies[key]["value"])])
Esempio n. 2
0
 def update_cookies_list(self, cookies_store):
     cookies_store.clear()
     # key, active, site, value
     for key in self.cookies.keys():
         cookies_store.append([key, self.cookies[key]["active"],
                               self.cookies[key]["site"],
                               encode_cookie_values(self.cookies[key]["value"])])
 def test_encode_cookie_values(self):
     expected = "key3=value3; key2=value2; key1=value1"
     cookie_pairs = {}
     cookie_pairs["key1"] = "value1"
     cookie_pairs["key2"] = "value2"
     cookie_pairs["key3"] = "value3"
     encoded = http.encode_cookie_values(cookie_pairs)
     self.assertEquals(encoded, expected)
Esempio n. 4
0
 def test_encode_cookie_values(self):
     expected = ['key1=value1', 'key2=value2', 'key3=value3']
     cookie_pairs = {}
     cookie_pairs["key1"] = "value1"
     cookie_pairs["key2"] = "value2"
     cookie_pairs["key3"] = "value3"
     encoded = http.encode_cookie_values(cookie_pairs)
     self.assertEquals(sorted(encoded.split("; ")), expected)