[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] Implementing draft to update RFC6265

From: Darshit Shah
Subject: Re: [Bug-wget] Implementing draft to update RFC6265
Date: Sun, 31 Jan 2016 18:02:31 +0100

On 31 January 2016 at 17:55, Ander Juaristi <address@hidden> wrote:
> On 01/30/2016 09:31 PM, Kushagra Singh wrote:
>> Hi,
>> I'm a bit stuck while writing tests. How do I test the fact that a secure
>> only cookie does not get saved over an insecure connection? Even if the
>> cookie gets saved, it will not be transmitted over an insecure connection
>> (cookie_matches_url() ensures that). So even though I can see in the log
>> that the cookie is not saved, I can't figure out how exactly to test that
>> in the test suite, since I cannot check using RejectHeader. Please find
>> attached the test I have written.
> I've tried passing '--save-cookies=mycookies.wget', which creates a new file
> in the test's directory, and then adding that file to the
> 'ExpectedDownloadedFiles' list, for Wget to check if it's there. The problem
> is the content check always fails, because Wget introduces comments at the
> top of the cookie file that include the time and date, and thus the test
> always fails saying that the contents don't match.
> I guess the solution here would be to create a hook and test that a cookie
> file has been created, which has nothing but the initial comments.
> I don't know if that would be possible. @Darshit?

Yes, a new hook for that would be possible. Should not be too hard, I
would suggest a specific ExpectedCookieFile hook, that ignores the
comment line and then tests for expected cookies in that file.
It increases the number of specific hooks we maintain, but seems like
the best idea to me. This could in fact be used to simplify some of
the cookie tests which currently use RejectHeader, and could also test
for session cookies correctly.

>> And one thing I noticed, Test-Proto.py tries to import HTTP and HTTPS
>> classes from " misc.constants", which is wrong. It should be imported from
>> test.base_test right?
>> Regards,
>> Kushagra
> Regards,
> - AJ

Thanking You,
Darshit Shah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]