Unittesting for web applications

2005-02-12 Thread Sandip Bhattacharya
Can someone suggest me some good resources for learning how to use
unittests for web applications? Do we always have to cook up our own
webpage scrapers to test the code?

- Sandip

-- 
Sandip Bhattacharya*Puroga Technologies   * [EMAIL PROTECTED]
Work: http://www.puroga.com   *Home/Blog: http://www.sandipb.net/blog

PGP/GPG Signature: 51A4 6C57 4BC6 8C82 6A65 AE78 B1A1 2280 A129 0FF3



-- 
http://mail.python.org/mailman/listinfo/python-list


[Tutor] Re: Reading text lines from a socket

2005-03-25 Thread Sandip Bhattacharya
[Reposting to the general list too]

Lloyd Kvam wrote:
> Sockets deal with packetized data.  The network protocols do not guarantee
> keeping the data in line oriented chunks - even if the data starts out
> that way.
>
> You need to deal with extracting lines from chunks.  So long as the
> connection is
> working properly, this is easy.  The challenge occurs when the remainder
> of a line
> never gets delivered.  The best strategy depends upon the details of
> what you are
> doing.

I understand that. In Python using sockets is like using sockets in C.

However, I was looking for a python equivalent of the perl idiom of
opening a socket and getting a file handle ... and then reading this
file handle as any other line oriented file using $socket->readline

I am trying to write a simple Netcraft style script which tries the HEAD
method on a webserver and reads the Server: header from the response. I
would not like to use urllib, because even a call to something like
urllib.info() reads in the complete webpage on an open().

Even if this particular problem could be done elegantly, I would be
interested to know the answer to my original question because the
feature of reading a line at a time from a socket will help me in a lot
of other places in the future.

- Sandip

--
Sandip Bhattacharya
sandip (at) puroga.com
Puroga Technologies Pvt. Ltd.
Work: http://www.puroga.comHome: http://www.sandipb.net

GPG: 51A4 6C57 4BC6 8C82 6A65 AE78 B1A1 2280 A129 0FF3


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

--
http://mail.python.org/mailman/listinfo/python-list


Re: script that parses command line, and execfile('')

2008-11-04 Thread Sandip Bhattacharya
On Nov 4, 12:43 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> def main(argv=None):
>      if argv is None: argv = sys.argv[1:]
>      ...

Wouldn't that make optparse miss the first parameter sys.argv[1]
mistaking it to be the name of the current program?

- Sandip
--
http://mail.python.org/mailman/listinfo/python-list


Problem in PDF version of current docs - no title

2008-11-04 Thread Sandip Bhattacharya
(docs AT python.org doesn't like non-subscribers. Probably that is why
my mail didn't get through. Sending to this list instead.)

I just downloaded the PDF (tar.gz) version of the docs at  
http://docs.python.org/download.html.

All the howtos seem to be titled "HOWTO". I am certain this is an
error
and unintended.

- Sandip

PS. Do cc me in replies.
--
http://mail.python.org/mailman/listinfo/python-list