Skip to content

Commit c1ee807

Browse files
committed
Add ZnHTTPSTest>>#testTransfersGzip to explicitly test the use of GZIP transfer encoding over HTTPS
1 parent e5c1970 commit c1ee807

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

repository/Zinc-Zodiac-Tests.package/ZnHTTPSTest.class/instance/testTransfers.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ testTransfers
1010
https;
1111
host: 's3-eu-west-1.amazonaws.com';
1212
addPath: 'public-stfx-eu';
13-
addPath: ('test-', size asString, '.txt');
13+
addPath: ('test-{1}.txt' format: { size });
1414
get;
1515
close.
1616
self assert: client isSuccess.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
testing
2+
testTransfersGzip
3+
| client |
4+
self timeLimit: 300 seconds.
5+
self ensureSocketStreamFactory.
6+
self isNativeSSLPluginPresent ifFalse: [ ^ self ].
7+
(client := self httpClient)
8+
https;
9+
host: 'stfx.eu';
10+
setAcceptEncodingGzip.
11+
(Integer primesUpTo: 100) do: [ :each | | size |
12+
size := 1024 * each + each.
13+
client
14+
url: ('test-{1}.txt' format: { size });
15+
setAcceptEncodingGzip;
16+
get.
17+
self assert: client isSuccess.
18+
self assert: (client response contentType matches: ZnMimeType textPlain).
19+
self assert: client response contentLength equals: size.
20+
self assert: (client response headers at: 'Content-Encoding') equals: 'gzip'.
21+
self
22+
assert: client contents
23+
equals: (self class generateTestData: size) ]

repository/Zinc-Zodiac-Tests.package/ZnHTTPSTest.class/instance/testTransfersSingleClient.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ testTransfersSingleClient
99
(Integer primesUpTo: 100) do: [ :each | | size |
1010
size := 1024 * each + each.
1111
client
12-
url: ('/public-stfx-eu/test-', size asString, '.txt');
12+
url: ('/public-stfx-eu/test-{1}.txt' format: { size });
1313
get.
1414
self assert: client isSuccess.
1515
self assert: (client response contentType matches: ZnMimeType textPlain).
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SystemOrganization addCategory: #'Zinc-Zodiac-Tests'!
1+
self packageOrganizer ensurePackage: #'Zinc-Zodiac-Tests' withTags: #()!

0 commit comments

Comments
 (0)