Tcl Source Code

Check-in [8321eb1dcd]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added test suites for more of the http package, two procedures left to do test suites for.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-452
Files: files | file ages | folders
SHA1: 8321eb1dcdabfaf854d392e286e5a6ed04276c96
User & Date: gerald 2017-06-23 20:08:13
Context
2017-06-23
20:49
Tests for ::http::Write done. check-in: 0926e525f7 user: gerald tags: tip-452
20:08
Added test suites for more of the http package, two procedures left to do test suites for. check-in: 8321eb1dcd user: gerald tags: tip-452
2017-06-22
03:33
Added additional tests into rewrite of http test package. check-in: e8c535c2c0 user: gerald tags: tip-452
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/http-tip-452.test.

5660
5661
5662
5663
5664
5665
5666
5667























































































































































































































































































































































































































































































































































































































































































5668
















































































5669
5670

5671
5672
5673


5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
        } \
        -result {1 {unsupported content-encoding "unknown"}}


    ##
    ## Test http::Connected
    ##
    ::tcltest::test http-31.1 {http::Connected}  \























































































































































































































































































































































































































































































































































































































































































        -setup {
















































































        } \
        -body {

            list Test Not Yet Implemented
        } \
        -cleanup {


            ::tcltest::testCleanup
        } \
        -result {}

    ##
    ## Test http::ReceiveChunked
    ##
    proc ::httpTest::ReceiveChunkedHelper {args} {
        return;
    }







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


>
|


>
>


|







5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
        } \
        -result {1 {unsupported content-encoding "unknown"}}


    ##
    ## Test http::Connected
    ##
    ::tcltest::test http-31.1 {http::Connected -- not a query, not a querychannel, validate off, no method, no handler, no error, no headers}  \
        -setup {
            ::tcltest::saveVars {
                ::http::http
                ::http::urlTypes
            }
            ::tcltest::testSetup {
                ::fconfigure {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::fileevent {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::flush {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::puts {
                    * {
                        use {
                            prefix {lappend ::httpTest::PutsList }
                        }
                    }
                }
                ::tell {
                    1 {
                        returns {0}
                        code {ok}
                    }
                    2 {
                        returns {1024}
                        code {ok}
                    }
                }
                ::http::Event {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Finish {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Write {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
            }
            array set ::httpTest::TestToken {
                accept-types {*}
                querylength {}
                sock {TestSocket}
                socketinfo {http://test.me/some/url}
                status {}
                -blocksize {1024}
                ?-handler {}
                -headers {}
                -keepalive {no}
                ?-method {}
                -protocol {1.1}
                ?-querychannel {}
                ?-query {}
                -type {}
                -validate {no}
            }
            set ::http::urlTypes(http) 80
            set ::errorInfo {}
            set ::errorCode {}
            set ::httpTest::PutsList {}
        } \
        -body {
            set status [catch {http::Connected ::httpTest::TestToken http phost srvurl} results]
            list $status $results [::tcltest::callCount] $::httpTest::PutsList
        } \
        -cleanup {
            unset ::httpTest::TestToken
            unset ::httpTest::PutsList
            ::tcltest::testCleanup
        } \
        -result {0 {} {::fconfigure,count 2 ::fileevent,count 1 ::flush,count 1 ::http::Event,count 0 ::http::Finish,count 0 ::http::Write,count 0 ::puts,count 7 ::tell,count 0} {TestSocket {GET srvurl HTTP/1.1} TestSocket {Host: http://test.me/some/url} TestSocket {User-Agent: UserAgent} TestSocket {Connection: close} TestSocket {Accept: *} TestSocket {Accept-Encoding: gzip,deflate,compress} TestSocket {}}}

    ::tcltest::test http-31.2 {http::Connected -- query, not a querychannel, validate off, no method, no handler, no error, no headers}  \
        -setup {
            ::tcltest::saveVars {
                ::http::http
                ::http::urlTypes
            }
            ::tcltest::testSetup {
                ::fconfigure {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::fileevent {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::flush {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::puts {
                    * {
                        use {
                            prefix {lappend ::httpTest::PutsList }
                        }
                    }
                }
                ::tell {
                    1 {
                        returns {0}
                        code {ok}
                    }
                    2 {
                        returns {1024}
                        code {ok}
                    }
                }
                ::http::Event {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Finish {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Write {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
            }
            array set ::httpTest::TestToken {
                accept-types {*}
                querylength {}
                sock {TestSocket}
                socketinfo {http://test.me/some/url}
                status {}
                -blocksize {1024}
                ?-handler {}
                -headers {}
                -keepalive {no}
                ?-method {}
                -protocol {1.1}
                ?-querychannel {}
                -query {This is a Query}
                -type {}
                -validate {no}
            }
            set ::http::urlTypes(http) 80
            set ::errorInfo {}
            set ::errorCode {}
            set ::httpTest::PutsList {}
        } \
        -body {
            set status [catch {http::Connected ::httpTest::TestToken http phost srvurl} results]
            list $status $results [::tcltest::callCount] $::httpTest::PutsList
        } \
        -cleanup {
            unset ::httpTest::TestToken
            unset ::httpTest::PutsList
            ::tcltest::testCleanup
        } \
        -result {0 {} {::fconfigure,count 3 ::fileevent,count 1 ::flush,count 0 ::http::Event,count 0 ::http::Finish,count 0 ::http::Write,count 0 ::puts,count 9 ::tell,count 0} {TestSocket {POST srvurl HTTP/1.1} TestSocket {Host: http://test.me/some/url} TestSocket {User-Agent: UserAgent} TestSocket {Connection: close} TestSocket {Accept: *} TestSocket {Accept-Encoding: gzip,deflate,compress} TestSocket {Content-Type: } TestSocket {Content-Length: 15} TestSocket {}}}

    ::tcltest::test http-31.3 {http::Connected -- not query, querychannel, validate off, no method, no handler, no error, no headers}  \
        -setup {
            ::tcltest::saveVars {
                ::http::http
                ::http::urlTypes
            }
            ::tcltest::testSetup {
                ::fconfigure {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::fileevent {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::flush {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::puts {
                    * {
                        use {
                            prefix {lappend ::httpTest::PutsList }
                        }
                    }
                }
                ::tell {
                    1 {
                        returns {0}
                        code {ok}
                    }
                    2 {
                        returns {1024}
                        code {ok}
                    }
                }
                ::http::Event {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Finish {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Write {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
            }
            array set ::httpTest::TestToken {
                accept-types {*}
                querylength {}
                sock {TestSocket}
                socketinfo {http://test.me/some/url}
                status {}
                -blocksize {1024}
                ?-handler {}
                -headers {}
                -keepalive {no}
                ?-method {}
                -protocol {1.1}
                -querychannel {TestQueryChannel}
                ?-query {}
                -type {}
                -validate {no}
            }
            set ::http::urlTypes(http) 80
            set ::errorInfo {}
            set ::errorCode {}
            set ::httpTest::PutsList {}
        } \
        -body {
            set status [catch {http::Connected ::httpTest::TestToken http phost srvurl} results]
            list $status $results [::tcltest::callCount] $::httpTest::PutsList
        } \
        -cleanup {
            unset ::httpTest::TestToken
            unset ::httpTest::PutsList
            ::tcltest::testCleanup
        } \
        -result {0 {} {::fconfigure,count 4 ::fileevent,count 1 ::flush,count 0 ::http::Event,count 0 ::http::Finish,count 0 ::http::Write,count 0 ::puts,count 9 ::tell,count 0} {TestSocket {POST srvurl HTTP/1.1} TestSocket {Host: http://test.me/some/url} TestSocket {User-Agent: UserAgent} TestSocket {Connection: close} TestSocket {Accept: *} TestSocket {Accept-Encoding: gzip,deflate,compress} TestSocket {Content-Type: } TestSocket {Content-Length: } TestSocket {}}}

    ::tcltest::test http-31.4 {http::Connected -- not query, not querychannel, validate on, no method, no handler, no error, no headers}  \
        -setup {
            ::tcltest::saveVars {
                ::http::http
                ::http::urlTypes
            }
            ::tcltest::testSetup {
                ::fconfigure {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::fileevent {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::flush {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::puts {
                    * {
                        use {
                            prefix {lappend ::httpTest::PutsList }
                        }
                    }
                }
                ::tell {
                    1 {
                        returns {0}
                        code {ok}
                    }
                    2 {
                        returns {1024}
                        code {ok}
                    }
                }
                ::http::Event {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Finish {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Write {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
            }
            array set ::httpTest::TestToken {
                accept-types {*}
                querylength {}
                sock {TestSocket}
                socketinfo {http://test.me/some/url}
                status {}
                -blocksize {1024}
                ?-handler {}
                -headers {}
                -keepalive {no}
                ?-method {}
                -protocol {1.1}
                -querychannel {TestQueryChannel}
                ?-query {}
                -type {}
                -validate {yes}
            }
            set ::http::urlTypes(http) 80
            set ::errorInfo {}
            set ::errorCode {}
            set ::httpTest::PutsList {}
        } \
        -body {
            set status [catch {http::Connected ::httpTest::TestToken http phost srvurl} results]
            list $status $results [::tcltest::callCount] $::httpTest::PutsList
        } \
        -cleanup {
            unset ::httpTest::TestToken
            unset ::httpTest::PutsList
            ::tcltest::testCleanup
        } \
        -result {0 0 {::fconfigure,count 2 ::fileevent,count 0 ::flush,count 0 ::http::Event,count 0 ::http::Finish,count 1 ::http::Write,count 0 ::puts,count 7 ::tell,count 0} {TestSocket {HEAD srvurl HTTP/1.1} TestSocket {Host: http://test.me/some/url} TestSocket {User-Agent: UserAgent} TestSocket {Connection: close} TestSocket {Accept: *} TestSocket {Accept-Encoding: gzip,deflate,compress} TestSocket {Content-Type: }}}

    ::tcltest::test http-31.5 {http::Connected -- not query, not querychannel, validate off, use method TESTING, no handler, no error, no headers}  \
        -setup {
            ::tcltest::saveVars {
                ::http::http
                ::http::urlTypes
            }
            ::tcltest::testSetup {
                ::fconfigure {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::fileevent {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::flush {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::puts {
                    * {
                        use {
                            prefix {lappend ::httpTest::PutsList }
                        }
                    }
                }
                ::tell {
                    1 {
                        returns {0}
                        code {ok}
                    }
                    2 {
                        returns {1024}
                        code {ok}
                    }
                }
                ::http::Event {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Finish {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Write {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
            }
            array set ::httpTest::TestToken {
                accept-types {*}
                querylength {}
                sock {TestSocket}
                socketinfo {http://test.me/some/url}
                status {}
                -blocksize {1024}
                ?-handler {}
                -headers {}
                -keepalive {no}
                -method {TESTING}
                -protocol {1.1}
                -querychannel {TestQueryChannel}
                ?-query {}
                -type {}
                -validate {no}
            }
            set ::http::urlTypes(http) 80
            set ::errorInfo {}
            set ::errorCode {}
            set ::httpTest::PutsList {}
        } \
        -body {
            set status [catch {http::Connected ::httpTest::TestToken http phost srvurl} results]
            list $status $results [::tcltest::callCount] $::httpTest::PutsList
        } \
        -cleanup {
            unset ::httpTest::TestToken
            unset ::httpTest::PutsList
            ::tcltest::testCleanup
        } \
        -result {0 {} {::fconfigure,count 4 ::fileevent,count 1 ::flush,count 0 ::http::Event,count 0 ::http::Finish,count 0 ::http::Write,count 0 ::puts,count 9 ::tell,count 0} {TestSocket {TESTING srvurl HTTP/1.1} TestSocket {Host: http://test.me/some/url} TestSocket {User-Agent: UserAgent} TestSocket {Connection: close} TestSocket {Accept: *} TestSocket {Accept-Encoding: gzip,deflate,compress} TestSocket {Content-Type: } TestSocket {Content-Length: } TestSocket {}}}

    ::tcltest::test http-31.6 {http::Connected -- not query, not querychannel, validate off, no method, with handler TESTHANDLER, no error, no headers}  \
        -setup {
            ::tcltest::saveVars {
                ::http::http
                ::http::urlTypes
            }
            ::tcltest::testSetup {
                ::fconfigure {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::fileevent {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::flush {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::puts {
                    * {
                        use {
                            prefix {lappend ::httpTest::PutsList }
                        }
                    }
                }
                ::tell {
                    1 {
                        returns {0}
                        code {ok}
                    }
                    2 {
                        returns {1024}
                        code {ok}
                    }
                }
                ::http::Event {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Finish {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Write {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
            }
            array set ::httpTest::TestToken {
                accept-types {*}
                querylength {}
                sock {TestSocket}
                socketinfo {http://test.me/some/url}
                status {}
                -blocksize {1024}
                -handler {TESTHANDLER}
                -headers {}
                -keepalive {no}
                ?-method {}
                -protocol {1.1}
                -querychannel {TestQueryChannel}
                ?-query {}
                -type {}
                -validate {no}
            }
            set ::http::urlTypes(http) 80
            set ::errorInfo {}
            set ::errorCode {}
            set ::httpTest::PutsList {}
        } \
        -body {
            set status [catch {http::Connected ::httpTest::TestToken http phost srvurl} results]
            list $status $results [::tcltest::callCount] $::httpTest::PutsList
        } \
        -cleanup {
            unset ::httpTest::TestToken
            unset ::httpTest::PutsList
            ::tcltest::testCleanup
        } \
        -result {0 {} {::fconfigure,count 4 ::fileevent,count 1 ::flush,count 0 ::http::Event,count 0 ::http::Finish,count 0 ::http::Write,count 0 ::puts,count 7 ::tell,count 0} {TestSocket {POST srvurl HTTP/1.0} TestSocket {Host: http://test.me/some/url} TestSocket {User-Agent: UserAgent} TestSocket {Accept: *} TestSocket {Content-Type: } TestSocket {Content-Length: } TestSocket {}}}

    ::tcltest::test http-31.7 {http::Connected -- not query, not querychannel, validate off, no method, no handler, with error at first puts, no headers}  \
        -setup {
            ::tcltest::saveVars {
                ::http::http
                ::http::urlTypes
            }
            ::tcltest::testSetup {
                ::fconfigure {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::fileevent {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::flush {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::puts {
                    1 {
                        returns {PUTS FAILED}
                        code {error}
                        errorcode {HTTP TEST PUTSFAILED}
                    }
                    * {
                        use {
                            prefix {lappend ::httpTest::PutsList }
                        }
                    }
                }
                ::tell {
                    1 {
                        returns {0}
                        code {ok}
                    }
                    2 {
                        returns {1024}
                        code {ok}
                    }
                }
                ::http::Event {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Finish {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Write {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
            }
            array set ::httpTest::TestToken {
                accept-types {*}
                querylength {}
                sock {TestSocket}
                socketinfo {http://test.me/some/url}
                status {}
                -blocksize {1024}
                ?-handler {}
                -headers {}
                -keepalive {no}
                ?-method {}
                -protocol {1.1}
                -querychannel {TestQueryChannel}
                ?-query {}
                -type {}
                -validate {no}
            }
            set ::http::urlTypes(http) 80
            set ::errorInfo {}
            set ::errorCode {}
            set ::httpTest::PutsList {}
        } \
        -body {
            set status [catch {http::Connected ::httpTest::TestToken http phost srvurl} results]
            list $status $results [::tcltest::callCount] $::httpTest::PutsList
        } \
        -cleanup {
            unset ::httpTest::TestToken
            unset ::httpTest::PutsList
            ::tcltest::testCleanup
        } \
        -result {0 0 {::fconfigure,count 3 ::fileevent,count 0 ::flush,count 0 ::http::Event,count 0 ::http::Finish,count 1 ::http::Write,count 0 ::puts,count 1 ::tell,count 0} {}}

    ::tcltest::test http-31.8 {http::Connected -- not query, not querychannel, validate off, no method, no handler, no error, with headers TESTING == true}  \
        -setup {
            ::tcltest::saveVars {
                ::http::http
                ::http::urlTypes
            }
            ::tcltest::testSetup {
                ::fconfigure {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::fileevent {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::flush {
                    * {
                        returns {}
                        code {ok}
                    }
                }
                ::puts {
                    * {
                        use {
                            prefix {lappend ::httpTest::PutsList }
                        }
                    }
                }
                ::tell {
                    1 {
                        returns {0}
                        code {ok}
                    }
                    2 {
                        returns {1024}
                        code {ok}
                    }
                }
                ::http::Event {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Finish {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
                ::http::Write {
                    * {
                        returns {0}
                        code {ok}
                    }
                }
            }
            array set ::httpTest::TestToken {
                accept-types {*}
                querylength {}
                sock {TestSocket}
                socketinfo {http://test.me/some/url}
                status {}
                -blocksize {1024}
                ?-handler {}
                -headers {TESTING true}
                -keepalive {no}
                ?-method {}
                -protocol {1.1}
                -querychannel {TestQueryChannel}
                ?-query {}
                -type {}
                -validate {no}
            }
            set ::http::urlTypes(http) 80
            set ::errorInfo {}
            set ::errorCode {}
            set ::httpTest::PutsList {}
        } \
        -body {
            set status [catch {http::Connected ::httpTest::TestToken http phost srvurl} results]
            list $status $results [::tcltest::callCount] $::httpTest::PutsList
        } \
        -cleanup {
            unset ::httpTest::TestToken
            unset ::httpTest::PutsList
            ::tcltest::testCleanup
        } \
        -result {0 {} {::fconfigure,count 4 ::fileevent,count 1 ::flush,count 0 ::http::Event,count 0 ::http::Finish,count 0 ::http::Write,count 0 ::puts,count 10 ::tell,count 0} {TestSocket {POST srvurl HTTP/1.1} TestSocket {Host: http://test.me/some/url} TestSocket {User-Agent: UserAgent} TestSocket {Connection: close} TestSocket {TESTING: true} TestSocket {Accept: *} TestSocket {Accept-Encoding: gzip,deflate,compress} TestSocket {Content-Type: } TestSocket {Content-Length: } TestSocket {}}}

    ##
    ## Test http::ReceiveChunked
    ##
    proc ::httpTest::ReceiveChunkedHelper {args} {
        return;
    }