def verifyConstructorArgument(testCase, cls, argName, defaultVal, altVal, attrName=None):
 if (attrName is None):
  attrName = argName
 actual = {}
 expected = {'defaultVal': defaultVal, 'altVal': altVal}
 o = cls()
 actual['defaultVal'] = getattr(o, attrName)
 o = cls(**{argName: altVal})
 actual['altVal'] = getattr(o, attrName)
 testCase.assertEqual(expected, actual)

def verifyConstructorArgument ( testCase , cls , argName , defaultVal , altVal , attrName = None ) : if ( attrName is None ) : attrName = argName actual = { } expected = { 'defaultVal' : defaultVal , 'altVal' : altVal } o = cls ( ) actual [ 'defaultVal' ] = getattr ( o , attrName ) o = cls ( ** { argName : altVal } ) actual [ 'altVal' ] = getattr ( o , attrName ) testCase . assertEqual ( expected , actual )
verify that an attribute has the expected default value and that a corresponding argument passed to a constructor is assigned to that attribute .