summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2017-11-12 23:28:40 +0100
committerRicardo Wurmus <rekado@elephly.net>2017-11-12 23:28:40 +0100
commit841fc3d1021723930d9d8e1b6a754555bb092514 (patch)
treeb4b8ee3fc6feca56d5838f4adbef786eeb7be2d2
parent61f44917ab3c7023f6f6ab242ce657b784e455d8 (diff)
tests: Add trivial test for get-bugs.
* tests/operations.scm: Add test "get-bugs generates soap request XML". * tests/requests/get-bugs.xml: New file.
-rw-r--r--tests/operations.scm9
-rw-r--r--tests/requests/get-bugs.xml1
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/operations.scm b/tests/operations.scm
index f7222fb..889fc0b 100644
--- a/tests/operations.scm
+++ b/tests/operations.scm
@@ -59,4 +59,13 @@
(xml->sxml (asset "responses/get-status1.xml")
#:trim-whitespace? #t))))
+
+(test-equal "get-bugs generates soap request XML"
+ (string-trim-both (asset "requests/get-bugs.xml"))
+ (with-output-to-string
+ (lambda _
+ (sxml->xml
+ (soap-request-body (get-bugs '(("package" . "guix-patches")
+ ("package" . "guix"))))))))
+
(test-end "operations")
diff --git a/tests/requests/get-bugs.xml b/tests/requests/get-bugs.xml
new file mode 100644
index 0000000..93a8cd7
--- /dev/null
+++ b/tests/requests/get-bugs.xml
@@ -0,0 +1 @@
+<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" soapenc:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><soap:Body><ns1:get_bugs xmlns:ns1="urn:Debbugs/SOAP" soapenc:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><ns1:query xsi:type="soapenc:Array" soapenc:arrayType="xsd:anyType[4]"><ns1:query xsi:type="xsd:string">package</ns1:query><ns1:query xsi:type="xsd:string">guix-patches</ns1:query><ns1:query xsi:type="xsd:string">package</ns1:query><ns1:query xsi:type="xsd:string">guix</ns1:query></ns1:query></ns1:get_bugs></soap:Body></soap:Envelope>