def assertDictContainsSubset(self, expected, actual, msg=None):
missing = []<EOL>mismatched = []<EOL>for key, value in expected.items():<EOL><INDENT>if key not in actual:<EOL><INDENT>missing.append(key)<EOL><DEDENT>elif value != actual[key]:<EOL><INDENT>mismatched.append('<STR_LIT>' %<EOL>(safe_repr(key), safe_repr(value),<EOL>safe_repr(actual[key])))<EOL><DEDENT><DEDENT>if not (missing or mismatched):<EOL><INDENT>return<EOL><DEDENT>standardMsg = '<STR_LIT>'<EOL>if missing:<EOL><INDENT>standardMsg = '<STR_LIT>' % '<STR_LIT:U+002C>'.join(safe_repr(m) for m in<EOL>missing)<EOL><DEDENT>if mismatched:<EOL><INDENT>if standardMsg:<EOL><INDENT>standardMsg += '<STR_LIT>'<EOL><DEDENT>standardMsg += '<STR_LIT>' % '<STR_LIT:U+002C>'.join(mismatched)<EOL><DEDENT>self.fail(self._formatMessage(msg, standardMsg))<EOL>
Checks whether actual is a superset of expected.