summaryrefslogtreecommitdiff
path: root/tests/util.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2016-01-27 01:36:43 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2016-02-22 21:32:05 +0900
commit1f5aa28db085779684dc7770b738c70093c9cfd8 (patch)
tree92ccf7799455f0527d183578c9fa93c6a3ba67f7 /tests/util.py
parent46138ca605af795062946e8fe2a67b5720b377e2 (diff)
downloadsphinx-git-1f5aa28db085779684dc7770b738c70093c9cfd8.tar.gz
Fix #1921: Support figure substitutions by locale
Diffstat (limited to 'tests/util.py')
-rw-r--r--tests/util.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/util.py b/tests/util.py
index 1e20e73e2..969c4e5c4 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -94,6 +94,16 @@ def assert_startswith(thing, prefix):
assert False, '%r does not start with %r' % (thing, prefix)
+def assert_node(node, cls=None, **kwargs):
+ if cls:
+ assert isinstance(node, cls), '%r is not subclass of %r' % (node, cls)
+
+ for key, value in kwargs.items():
+ assert key in node, '%r does not have %r attribute' % (node, key)
+ assert node[key] == value, \
+ '%r[%s]: %r does not equals %r' % (node, key, node[key], value)
+
+
try:
from nose.tools import assert_in, assert_not_in
except ImportError: