3
3KWA
Hi all,
I am wondering what is the standard doctest (test) practice for
functions who's returned value change all the time e.g. forex rate:
import urllib
def get_rate(symbol):
"""get_rate(symbol) connects to yahoo finance to return the rate of
symbol.
"""
url=
"http://finance.yahoo.com/d/quotes.csv?s=%s=X&f=sl1d1t1c1ohgv&e=.csv" %
\
symbol
f=urllib.urlopen(url)
return float(f.readline().split(',')[1])
As you can guess I am very new to unittest and doctest in general ...
Thanks for your help,
EuGeNe
I am wondering what is the standard doctest (test) practice for
functions who's returned value change all the time e.g. forex rate:
import urllib
def get_rate(symbol):
"""get_rate(symbol) connects to yahoo finance to return the rate of
symbol.
"""
url=
"http://finance.yahoo.com/d/quotes.csv?s=%s=X&f=sl1d1t1c1ohgv&e=.csv" %
\
symbol
f=urllib.urlopen(url)
return float(f.readline().split(',')[1])
As you can guess I am very new to unittest and doctest in general ...
Thanks for your help,
EuGeNe