diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-01-27 01:36:43 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-02-22 21:32:05 +0900 |
commit | 1f5aa28db085779684dc7770b738c70093c9cfd8 (patch) | |
tree | 92ccf7799455f0527d183578c9fa93c6a3ba67f7 /tests/util.py | |
parent | 46138ca605af795062946e8fe2a67b5720b377e2 (diff) | |
download | sphinx-git-1f5aa28db085779684dc7770b738c70093c9cfd8.tar.gz |
Fix #1921: Support figure substitutions by locale
Diffstat (limited to 'tests/util.py')
-rw-r--r-- | tests/util.py | 10 |
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: |