When i run doctest on the module, i get that error:
[sm@localhost Spyca]$ python Spyca.py
**********************************************************************
File "Spyca.py", line 840, in
__main__.City.Select_all
Failed example:
print City.Select_all(Country.Get_rowid('<default
country>'))
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python2.4/doctest.py", line
1243, in __run
compileflags, 1) in test.globs
File "<doctest __main__.City.Select_all[0]>",
line 1, in ?
print
City.Select_all(Country.Get_rowid('<default
country>'))
File "Spyca.py", line 846, in Select_all
return [cls(i) for i in
Db.Exec(sql).fetchall()]
File "Spyca.py", line 760, in __init__
elif isinstance(this, tuple) or
isinstance(this, list): self.Select_seq(this)
File "Spyca.py", line 817, in Select_seq
if not isinstance(seq[3], Latitude): raise
SpycaException(SpycaInitError, type(seq[3]))
SpycaException: Instanciation or argument error.
[<type 'unicode'>]
**********************************************************************
1 items had failures:
1 of 1 in __main__.City.Select_all
***Test Failed*** 1 failures.
Now, when i do all the same in the interpreter:
[sm@localhost Spyca]$ python
Python 2.4.1 (#2, Aug 25 2005, 18:20:57)
[GCC 4.0.1 (4.0.1-2mdk for Mandriva Linux release
2006.0)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import Spyca as S
>>> lat = S.Latitude()
>>> lon = S.Longitude()
>>> seq = (None, 'myCity', None, lat, lon, 0, '')
>>> c = S.City(seq)
>>> print c
myCity
>>> repr(c)
"[None, 'myCity', None, [0, 0 ,0, 0.0], [0, 0 ,0,
0.0], 0, '']"
>>>
As you can see, no error in the interpreter.
--------
Have a nice day. Thanks for the best scripting
language ;)
|