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: Sun, 15 Mar 2015 02:53:12 +0530

Hello everyone!
Apologies for silly mistakes I have done .
I am taking Darshit's suggestions as a lesson and will try not to
repeat those mistakes .
Also I will create new thread for queries which are not related .


Here is complete patch ( Please find attachment also ! ) :

>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

---
 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"""
+
+
+File1_rules = {
+
+    "Response"          : 503
+}
+
+A_File = WgetFile ("File1", File1, rules=File1_rules)
+
+Request_List = [
+    [
+        "GET /File1"
+
+    ]
+]
+
+
+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

Looking forward to verification :-) .


Thank you !
Satyam Zode
PICT Pune

Attachment: 0001-Added-wget-http-test-for-503-Service-unavailable.patch
Description: Text Data


reply via email to

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