summary refs log tree commit diff
path: root/tests/utils.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-08-28 15:32:30 +0100
committerMark Haines <mark.haines@matrix.org>2014-08-28 15:32:38 +0100
commit7b079a26a5bca2c4e22e34f3792d1cdd2230a95e (patch)
treefd6b595106c66d4e81d5e14226276163b7b41032 /tests/utils.py
parentuse @wraps to set the __name__ __module__ and __doc__ correctly for logged fu... (diff)
downloadsynapse-7b079a26a5bca2c4e22e34f3792d1cdd2230a95e.tar.xz
Remove get_state_for_room function from federation handler
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/utils.py b/tests/utils.py
index 6666b06931..b32d5ef356 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -28,6 +28,16 @@ from mock import patch, Mock
 import json
 import urlparse
 
+from inspect import getcallargs
+
+
+def get_mock_call_args(pattern_func, mock_func):
+    """ Return the arguments the mock function was called with interpreted
+    by the pattern functions argument list.
+    """
+    invoked_args, invoked_kargs = mock_func.call_args
+    return getcallargs(pattern_func, *invoked_args, **invoked_kargs)
+
 
 # This is a mock /resource/ not an entire server
 class MockHttpResource(HttpServer):