summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-07-17 15:26:47 +0100
committerRichard van der Hoff <richard@matrix.org>2018-07-17 15:26:47 +0100
commit2f5dfe299cbbeb34ed686c9ee1ab14ded13f368c (patch)
tree6b91ad3e6a2b0f002e1d4f26fe229c5a5736d541 /tests/unittest.py
parentMerge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes (diff)
parentMerge pull request #3546 from matrix-org/rav/fix_erasure_over_federation (diff)
downloadsynapse-2f5dfe299cbbeb34ed686c9ee1ab14ded13f368c.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unittest.py b/tests/unittest.py

index b25f2db5d5..b15b06726b 100644 --- a/tests/unittest.py +++ b/tests/unittest.py
@@ -109,6 +109,17 @@ class TestCase(unittest.TestCase): except AssertionError as e: raise (type(e))(e.message + " for '.%s'" % key) + def assert_dict(self, required, actual): + """Does a partial assert of a dict. + + Args: + required (dict): The keys and value which MUST be in 'actual'. + actual (dict): The test result. Extra keys will not be checked. + """ + for key in required: + self.assertEquals(required[key], actual[key], + msg="%s mismatch. %s" % (key, actual)) + def DEBUG(target): """A decorator to set the .loglevel attribute to logging.DEBUG.