On Tue, 2010-08-10 at 15:32 +0200, Kamil Páral wrote:
> ---
> hooks/post-bodhi-update/README | 2 +-
> hooks/post-bodhi-update/hook.py | 3 +--
> 2 files changed, 2 insertions(+), 3 deletions(-)
One thing to note - you've changed the definition of testdata.
Previously, we (informally) defined it to be a dictionary of key=val
pairs, where both key and val were objects of type 'str'.
Passing a value of type 'list' will still work, because autoqa is
using
%r to format testdata when it writes it into the control file, and the
result of repr(listval) can be evaluated to reproduce the original
list.
So this is fine - in fact we can pass list, str, dict, set, or any
other
type where the result of repr(val) can be evaluated back into the
original object.
But NOTE: while I'm fairly sure that all builtin python types should
work, this does NOT mean we can throw ANY python object into testdata
and have it come out the other side intact. For example, if we tried
to
pass (let's say) a bugzilla.Bug() into testdata, we'd end up with a
str
value like:
'<Bug #1337 on
https://bugzilla.redhat.com/xmlrpc.cgi at 0x999f06c>'
But that's being a little pedantic - since we're populating testdata
from the results of OptionParser, we're unlikely to be passing
anything
other than str and lists of strs. So this patch is fine, so long as we
remember not to get too fancy with our values in the future.
I have quite forgotten we write out this data into the control file.
But still, passing native python list seemed to me a better choice than
using comma/space separated strings (different approach for different
hooks) and easier for test writers. Sure, we can't pass on arbitrary
object type.