Rewrite test to not use assertDictEqual.

assertDictEqual was introduced with Python 2.7, but all code needs to be able
to run on Python 2.6.6.