bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] [PATCH] Added wget http test for 503 Service unavailable


From: Satyam Zode
Subject: Re: [Bug-wget] [PATCH] Added wget http test for 503 Service unavailable
Date: Sat, 18 Apr 2015 19:57:26 +0530

Hello everyone !
Apologies for the delay in response. First of all thanks Darshit for
putting errors in limelight. Please find attached latest and updated
version of the patch.
Before sending patch here I tested it on another copy of source and it
worked well for me.

Thank you!
Satyam Zode
PICT , Pune


On Wed, Apr 15, 2015 at 2:23 PM, Darshit Shah <address@hidden> wrote:
> Hi Satyam,
>
> If I remember correctly, this was the latest version of your patch. I have a
> few comments about it, after which we can begin merging it into the code
> base.
>
>> From 55b0bb821496f324f133283c8c7ba35c3a64ee63 Mon Sep 17 00:00:00 2001
>> From: Satyam Zode <address@hidden>
>> Date: Sun, 15 Mar 2015 02:35:06 +0530
>> Subject: [PATCH] Added wget http test for 503 Service unavailable
>>
> Could you *please* write a commit message in the GNU ChangeLog style? Take a
> look at the other commit messages in the repository for ideas.
>
>> ---
>> testenv/Makefile.am |  1 +
>> testenv/Test-503.py | 59
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 60 insertions(+)
>> mode change 100644 => 100755 testenv/Makefile.am
>> create mode 100755 testenv/Test-503.py
>>
>> diff --git a/testenv/Makefile.am b/testenv/Makefile.am
>> old mode 100644
>> new mode 100755
>> index a4e0352..5360eb6
>> --- a/testenv/Makefile.am
>> +++ b/testenv/Makefile.am
>> @@ -52,6 +52,7 @@ if HAVE_PYTHON3
>>     Test-O.py                                       \
>>     Test-Post.py                                    \
>>     Test-504.py                                     \
>> +    Test-503.py                                     \
>>     Test--spider-r.py                               \
>>     Test-redirect-crash.py
>>
>> diff --git a/testenv/Test-503.py b/testenv/Test-503.py
>> new file mode 100755
>> index 0000000..21049ec
>> --- /dev/null
>> +++ b/testenv/Test-503.py
>> @@ -0,0 +1,59 @@
>> +#!/usr/bin/env python3
>> +from sys import exit
>> +from test.http_test import HTTPTest
>> +from misc.wget_file import WgetFile
>> +
>> +"""
>> +    This test ensures that Wget handles a 503 Service Unavailable
>> response
>> +    correctly.
>> +"""
>> +TEST_NAME = "503 Service Unavailable"
>> +############# File Definitions
>> ###############################################
>> +File1 = """ You have to learn the rules of the game. And then you
>> have to play better than anyone else. - Albert Einstein"""
>
> Please wrap this line to 80 characters.
>>
>> +
>> +
>> +File1_rules = {
>> +
>
> Un-necessary new line
>>
>> +    "Response"          : 503
>> +}
>> +
>> +A_File = WgetFile ("File1", File1, rules=File1_rules)
>> +
>> +Request_List = [
>> +    [
>> +        "GET /File1"
>> +
>
> Same
>
>> +    ]
>> +]
>> +
>> +
>> +WGET_OPTIONS = " "
>> +WGET_URLS = [["File1"]]
>> +
>> +Files = [[A_File]]
>> +
>> +ExpectedReturnCode = 8
>> +ExpectedDownloadedFiles = []
>> +
>> +################ Pre and Post Test Hooks
>> #####################################
>> +pre_test = {
>> +    "ServerFiles"       : Files
>> +}
>> +test_options = {
>> +    "WgetCommands"      : WGET_OPTIONS,
>> +    "Urls"              : WGET_URLS
>> +}
>> +post_test = {
>> +    "ExpectedFiles"     : ExpectedDownloadedFiles,
>> +    "ExpectedRetcode"   : ExpectedReturnCode,
>> +    "FilesCrawled"      : Request_List
>> +}
>> +
>> +err = HTTPTest (
>> +                name=TEST_NAME,
>> +                pre_hook=pre_test,
>> +                test_params=test_options,
>> +                post_hook=post_test
>> +).begin ()
>> +
>> +exit (err)
>> --
>> 1.9.1
>>
>
> Also, when I apply your patch Git complains about whitespace errors in two
> places. Please take a look at those too
>
>
> --
> Thanking You,
> Darshit Shah

Attachment: 0001-tests-Add-new-test-case-for-503-Service-unavailable.patch
Description: Text Data


reply via email to

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