def attrs_eq(received, **expected):
 for (k, v) in expected.iteritems():
  eq_(v, getattr(received, k))

def attrs_eq ( received , ** expected ) : for ( k , v ) in expected . iteritems ( ) : eq_ ( v , getattr ( received , k ) )
compares receiveds attributes with expecteds kwargs .