'Check that function(value) equals output.  If output is None,
check that function(value) equals value.'

def check_output(self, function, value, output=None):

    if (output is None):
        output = value
    self.assertEqual(function(value), output)
