You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by da...@apache.org on 2002/02/23 12:28:21 UTC

cvs commit: tcl-rivet/tests upload.rvt upload.test cookies.rvt rivet.test

davidw      02/02/23 03:28:21

  Modified:    tests    cookies.rvt rivet.test
  Added:       tests    upload.rvt upload.test
  Log:
  * tests/upload.test: Added upload test.
  
  Revision  Changes    Path
  1.2       +2 -2      tcl-rivet/tests/cookies.rvt
  
  Index: cookies.rvt
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/tests/cookies.rvt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- cookies.rvt	6 Jan 2002 13:30:54 -0000	1.1
  +++ cookies.rvt	23 Feb 2002 11:28:21 -0000	1.2
  @@ -1,8 +1,8 @@
   <?
   
  -load_cookies 
  +load_cookies
   
  -headers setcookie -name mod -value rivet -expires 01-01-2003 
  +headers setcookie -name mod -value rivet -expires 01-01-2003
   
   if { [ array exists cookies ] } {
       foreach { ck } [ array names cookies ]  {
  
  
  
  1.11      +2 -2      tcl-rivet/tests/rivet.test
  
  Index: rivet.test
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/tests/rivet.test,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- rivet.test	27 Jan 2002 16:10:23 -0000	1.10
  +++ rivet.test	23 Feb 2002 11:28:21 -0000	1.11
  @@ -6,7 +6,7 @@
   
   # See README file for more information.
   
  -# $Id: rivet.test,v 1.10 2002/01/27 16:10:23 davidw Exp $
  +# $Id: rivet.test,v 1.11 2002/02/23 11:28:21 davidw Exp $
   
   package require tcltest
   package require http
  @@ -18,7 +18,7 @@
   # with the desired result, which is placed after the block of code.
   # See man tcltest for more information.
   
  -foreach Test {cookies.test get.test post.test tclfile.test env.test hello.test include.test binary.test parse.test} {
  +foreach Test {cookies.test get.test post.test tclfile.test env.test hello.test include.test binary.test parse.test upload.test} {
       source $Test
   }
   
  
  
  
  1.1                  tcl-rivet/tests/upload.rvt
  
  Index: upload.rvt
  ===================================================================
  <?
  
  puts "[ upload names ] [ upload info uploadtest exists ] [ upload info uploadtest size ] [ upload info uploadtest type ] [ upload info uploadtest filename ]"
  
  ?>
  
  
  1.1                  tcl-rivet/tests/upload.test
  
  Index: upload.test
  ===================================================================
  # $Id: upload.test,v 1.1 2002/02/23 11:28:21 davidw Exp $
  
  set testfilename1 upload.rvt
  
  ::tcltest::test upload-1.1 {multipart/form-data} {
      set bound "-----NEXT_PART_[clock seconds].[pid]"
      set fl [open AngeloFish.jpg r]
      fconfigure $fl -translation binary
      set data [read $fl]
      close $fl
  
      set outputData "--$bound\nContent-Disposition: form-data; name=\"uploadtest\"; filename=\"AngeloFish.jpg\"\n\n$data\n${bound}--"
  
      set page [ ::http::geturl "${urlbase}$testfilename1" \
  		   -type "multipart/form-data; boundary=$bound" -query $outputData ]
  
      set ret [string trim [ ::http::data $page ]]
      set ret
  } {uploadtest 1 42781  AngeloFish.jpg}
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org