Remove dead/commented-out code, fold code with filter(), use
dict.values(), use assert(.. is None) instead of assertIsNone()