mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Override figure directive to apply :name: option to the figure itself
This commit is contained in:
@@ -36,29 +36,6 @@ def test_process_doc_handle_figure_caption():
|
||||
'testdoc', 'testid', 'caption text')
|
||||
|
||||
|
||||
def test_process_doc_handle_image_parent_figure_caption():
|
||||
env = mock.Mock(domaindata={})
|
||||
img_node = nodes.image('', alt='image alt')
|
||||
figure_node = nodes.figure(
|
||||
'',
|
||||
nodes.caption('caption text', 'caption text'),
|
||||
img_node,
|
||||
)
|
||||
document = mock.Mock(
|
||||
nametypes={'testname': True},
|
||||
nameids={'testname': 'testid'},
|
||||
ids={'testid': img_node},
|
||||
)
|
||||
|
||||
domain = StandardDomain(env)
|
||||
if 'testname' in domain.data['labels']:
|
||||
del domain.data['labels']['testname']
|
||||
domain.process_doc(env, 'testdoc', document)
|
||||
assert 'testname' in domain.data['labels']
|
||||
assert domain.data['labels']['testname'] == (
|
||||
'testdoc', 'testid', 'caption text')
|
||||
|
||||
|
||||
def test_process_doc_handle_table_title():
|
||||
env = mock.Mock(domaindata={})
|
||||
table_node = nodes.table(
|
||||
|
||||
Reference in New Issue
Block a user