'Checks whether actual is a superset of expected.'

def assertDictContainsSubset(self, expected, actual, msg=None):

    missing = []
    mismatched = []
    for (key, value) in expected.iteritems():
        if (key not in actual):
            missing.append(key)
        elif (value != actual[key]):
            mismatched.append(('%s,    expected:    %s,    actual:    %s' % (key, value, actual[key])))
    if (not (missing or mismatched)):
        return
    standardMsg = ''
    if missing:
        standardMsg = ('Missing:    %r' % ','.join(missing))
    if mismatched:
        if standardMsg:
            standardMsg += ';    '
        standardMsg += ('Mismatched    values:    %s' % ','.join(mismatched))
    self.fail(self._formatMessage(msg, standardMsg))
