[1]: Okay, if the GI based bindings do not handle these methods correctly, then parsing the iCalendar data is obviously needed.
[2] and [3]: If that is the case, then the tests are broken. Rather than working around tests that provide data in a form that differs from real life, the tests should provide stubs that behave enough like e-d-s events to run unmodified.
It should be simple enough to provide objects that have the get_as_string(), get_summary() and get_description_list() methods that provide the sample data.
Catching AttributeError like this is the wrong way to handle this kind of thing.
[4] and [5]: okay.
[6]: good. It is probably worth passing the other values through escape() too: while the dates may be safe, the location could potentially contain special characters. Escaping them all makes it clear for anyone who works on this in the future.
[1]: Okay, if the GI based bindings do not handle these methods correctly, then parsing the iCalendar data is obviously needed.
[2] and [3]: If that is the case, then the tests are broken. Rather than working around tests that provide data in a form that differs from real life, the tests should provide stubs that behave enough like e-d-s events to run unmodified.
It should be simple enough to provide objects that have the get_as_string(), get_summary() and get_description _list() methods that provide the sample data.
Catching AttributeError like this is the wrong way to handle this kind of thing.
[4] and [5]: okay.
[6]: good. It is probably worth passing the other values through escape() too: while the dates may be safe, the location could potentially contain special characters. Escaping them all makes it clear for anyone who works on this in the future.
[7]: looks good.