Remove use of has_key

Add test to ensure coverage.
PEP8: E222 space after operator
PEP8: W293 blank line contains whitespace
Mark some tests as xfail
Merge pull request #33 from dupuy/bug2780

Mark some tests as xfail for bug 2780