profile_tests.py: Add tests for loadTestProfile
profile_tests.py: Add tests for the TestProfile class

This adds a good number of tests for various functions of the
TestProfile class.

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
profile.py: Remove uses of keys, items and values as appropriate

These methods compute and return a list in python 2, Their iter* cousins
however do not return a list, but an iterator. This has memory saving
properties.
profile.py: use dict.iteritems() instead of keys

Doing dictionary lookup in a loop using a key is not a pythonic
constuct, use iteritems() to provide both the key and value as names in
the loop.
profile: Remove unnecessary if statement

This particular if doesn't present big performance wins, nor does it
affect the result of the code, but does make it harder to understand, so
just remove it.
profile.py: replace map() with generator expression

map() is considered semi-deprecated in python, since map() + lambda will
always be more expensive than a comprehension or generator expression.
profile.py: Update docstrings and comments

Adds or fixes docstrings and comments
profile.py: Cleanup a few pylint warnings

This adds self._dmesg definition to the TestProfile constructor (this
isn't necessary but it's good form), and renames self.__dmesg to
self._dmesg. A double underscore is not about making an name or method
private, it's about making it invisible to that class's children. We
don't want to hide self._dmesg from any children of TestProfile.
profile.py: stop exposing private methods of TestProfile

This patch stops exposing flatten_group_hierarchy and prepare_test_list
by marking them with a leading underscore. These methods weren't meant
to be called outside, and this is the pythonic way of letting users know
that these are "private" methods.
profile.py: set __all__

Setting the __all__ name in a module controls which names it exposes
when imported.
framework: rename profile.loadTestProfile to profile.load_test_profile

This is a more pythonic name for this method.

This patch was created with the following shell command:
find . -name '*py' | \
xargs sed -i -e 's!loadTestProfile!load_test_profile!g'