The Trunk: WebClient-Tests-topa.52.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: WebClient-Tests-topa.52.mcz

commits-2
Tobias Pape uploaded a new version of WebClient-Tests to project The Trunk:
http://source.squeak.org/trunk/WebClient-Tests-topa.52.mcz

==================== Summary ====================

Name: WebClient-Tests-topa.52
Author: topa
Time: 6 July 2017, 3:24:10.565021 pm
UUID: b84fa4c2-2761-4616-b545-68d816ae3f28
Ancestors: WebClient-Tests-topa.51

rename charset test, add gzip test

=============== Diff against WebClient-Tests-topa.51 ===============

Item was removed:
- ----- Method: WebClientServerTest>>testContentEncoding (in category 'tests - misc') -----
- testContentEncoding
- "Test encoding detection"
- | resp expected |
- expected := '«garçon Léon»'.
- #(
- 'latin-1' #[171 103  97 114 231 111 110  32  76 233 111 110 187]
- 'macroman' #[199 103  97 114 141 111 110  32  76 142 111 110 200]
- 'utf-8' #[194 171 103  97 114 195 167 111 110  32  76 195 169 111 110 194 187]
- ) pairsDo: [:name :bytes |
- server addService: '/testcontent', name action:[:req|req send200Response: bytes asString contentType: 'text/plain; charset=', name].
- resp := WebClient httpGet: self localHostUrl, '/testcontent', name.
- self assert: 200 equals: resp code.
- self assert: expected equals: resp content].
- !

Item was added:
+ ----- Method: WebClientServerTest>>testContentEncodingGZip (in category 'tests - misc') -----
+ testContentEncodingGZip
+ "Test content encoding"
+ | payload resp |
+ payload := 'hello' zipped.
+ server addService: '/testencoding' action: [:req|
+ req send200Response: payload contentType: 'text/plain' do: [:response |
+ response headerAt: 'Content-Encoding' put: 'gzip']].
+ resp := WebClient httpGet: self localHostUrl, '/testencoding'.
+ self assert: 200 equals: resp code.
+ self assert: 'hello' equals: resp content.
+ !

Item was added:
+ ----- Method: WebClientServerTest>>testContentTypeCharsetEncoding (in category 'tests - misc') -----
+ testContentTypeCharsetEncoding
+ "Test encoding detection"
+ | resp expected |
+ expected := '«garçon Léon»'.
+ #(
+ 'latin-1' #[171 103  97 114 231 111 110  32  76 233 111 110 187]
+ 'macroman' #[199 103  97 114 141 111 110  32  76 142 111 110 200]
+ 'utf-8' #[194 171 103  97 114 195 167 111 110  32  76 195 169 111 110 194 187]
+ ) pairsDo: [:name :bytes |
+ server addService: '/testcontent', name action:[:req|req send200Response: bytes asString contentType: 'text/plain; charset=', name].
+ resp := WebClient httpGet: self localHostUrl, '/testcontent', name.
+ self assert: 200 equals: resp code.
+ self assert: expected equals: resp content].
+ !