GTG

Code review comment for lp:~jml/gtg/more-tests

Revision history for this message
Jonathan Lange (jml) wrote :

The main purpose of this branch is to add tests for the Tag class.

The tests that I've added were designed to verify the current behaviour of the class. All of the tests pass running against the version of Tag that's in trunk. Two of the tests check behaviour that looks to me to be accidental, but I figured I'd add them and let someone who knows more than me make an informed decision.

Anyway, once the tests were written I took the opportunity to:
  a) Add docstrings for Tag
  b) Clean up whitespace
  c) Fix PEP 8 violations (remove spaces before colons, add spaces after commas, drop haskey usage)
  d) Changed the internal attributes to have underscore prefixes.
  e) Removed the "defensive" thing in get_all_attributes, since if ever 'name' isn't an attribute, it's actually a serious error.
  f) Changed set_attribute so that 'name' is slightly less special cased.

I think all of these changes are good ones, but tastes may vary.

jml

« Back to merge proposal