gsathya / htpt

HTTP Tor Pluggable Transport
Other
4 stars 3 forks source link

Added basic functionality for url encoding #8

Closed ben-jones closed 10 years ago

ben-jones commented 10 years ago

Created a urlEncode module with a variety of methods for url encoding and a series of unit tests to validate operation. Currently, cookie encoding does not work, but url encoding does.

ben-jones commented 10 years ago

I chose not to inline the functionality of the test for 2 reasons. 1) I wanted to be sure that I was the test was not dependent on another function and 2) I wanted to add flexibility to the unittest. If we suddenly think of an edge case, it is trivial to add it now. Ultimately, this is just personal preference though.

gsathya commented 10 years ago

I chose not to inline the functionality of the test for 2 reasons. 1) I wanted to be sure that I was the test was not dependent on another function and 2) I wanted to add flexibility to the unittest. If we suddenly think of an edge case, it is trivial to add it now. Ultimately, this is just personal preference though.

No no, in self.assertEqual(urlEncode.decodeAsCookie(cookie), datum), you're deriving the value for cookie exactly as how you would in encodeAsCookie. Shouldn't you just hardcode the value of cookie? Like for ex self.assertEqual(urlEncode.decodeAsCookie("some_cookie_value_that_is_hardcoded", datum)

gsathya commented 10 years ago

2dbf1bc990ecb8076ad1938c88885f43a1002875 needs the second line in the commit message to be line wrapped. I suggest using M-x fill-paragraph.

Amend the commit message and force push it. I'll merge it.

gsathya commented 10 years ago

Amend the commit message and force push it. I'll merge it.

I've fixed it.

gsathya commented 10 years ago

Merged. Thanks!