If you were testing if dict A is a subset of dict B, I think I would write a function that tries to extract the content of dict A from dict B making a new dict C and then assertEqual(A,C).
def extractDictAFromB(A,B):
return dict([(k,B[k]) for k in A.keys() if k in B.keys()])
then you could just do
assertEqual(A,extractDictAFromB(A,B))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…