spesmilo/electrum — pull request #736 by chrisglass (2014-06-26 09:17:11+00:00)
Title: Add tests to the SimpleConfig object (resubmit)

This branch refactors the SimpleConfig object quite heavily to make it (in my humble opinion) more readable and more testable.

I added some comments to make the logic easier to follow, and plastered the class with unit tests. Test coverage increased rather dramatically.

The config lock was made a RLock instead of a Lock, and it is now necessary to acquire the lock before doing a read (and so, the reentrant lock allows a thread to read if it already has the write lock).

A special note: I noticed some bits of the code used mutable data structure as default values for methods/functions. This is quite bad, since it causes undefined behavior (the mutable is stored on the class, and not the instance. So it is in effect shared by all instances).

Finally, the travis configuration was updated to run all modules except "gui" since it seems to lose it's brains when trying to import i18n stuff (I haven't looked at it yet, I might fix it later).