[Tutor] Test File Uploading using urllib

karim yaici karimy@nipltd.com
Thu, 12 Oct 2000 13:51:29 +0100


Hi guys,

I 'll probably nedd some help on this one or at least few advices. So
let me explain you what I am trying to do.

I am trying to write kinda testing system (with Python of course!).
let's say I have a form with many input fields and a submit button. I
want to test if the date that have been provided get added to the
database.  Instead of going to the web page and type in your data, I
used a method "urlpost()" to POST my data to the web page.Basically
urlpost has 2 args: (target_URL, dictionary), the dictioanry is of the
type {var:value},then it constructs a new url similar to the CGI one
"target_URL?var1=val1&var2=val2....etc" and the end I have only to
provide the dict* and loop...

Fine so far! but what if I want to test that a file get uploaded (for
intance, if I had an  upload button), I don't think I can POST a file in
the same manner as the other inputs, I'll probably have to use a
different method with the files....

If someone has got the slightiest idea on where to look or (better!)what
to do,I'll be really thankful.

Cheers

~Karim~
aka Zinou