@@ -38,14 +38,16 @@ def test_basics(make_app, rootdir):
38
38
assert section [0 ].astext () == 'greet'
39
39
assert isinstance (section [1 ], nodes .paragraph )
40
40
assert section [1 ].astext () == 'A sample command group.'
41
- assert isinstance (section [2 ], nodes .literal_block )
41
+ assert isinstance (section [2 ], nodes .target )
42
+ assert section [2 ].attributes ['refid' ] == 'greet'
43
+ assert isinstance (section [3 ], nodes .literal_block )
42
44
43
- assert isinstance (section [3 ], nodes .rubric )
44
- assert section [3 ].astext () == 'Commands'
45
- assert isinstance (section [4 ], sphinx_nodes .index )
46
- assert isinstance (section [5 ], sphinx_nodes .desc )
47
- assert isinstance (section [6 ], sphinx_nodes .index )
48
- assert isinstance (section [7 ], sphinx_nodes .desc )
45
+ assert isinstance (section [4 ], nodes .rubric )
46
+ assert section [4 ].astext () == 'Commands'
47
+ assert isinstance (section [5 ], sphinx_nodes .index )
48
+ assert isinstance (section [6 ], sphinx_nodes .desc )
49
+ assert isinstance (section [7 ], sphinx_nodes .index )
50
+ assert isinstance (section [8 ], sphinx_nodes .desc )
49
51
50
52
51
53
def test_nested_full (make_app , rootdir ):
@@ -82,23 +84,29 @@ def test_nested_full(make_app, rootdir):
82
84
assert section [0 ].astext () == 'greet'
83
85
assert isinstance (section [1 ], nodes .paragraph )
84
86
assert section [1 ].astext () == 'A sample command group.'
85
- assert isinstance (section [2 ], nodes .literal_block )
87
+ assert isinstance (section [2 ], nodes .target )
88
+ assert section [2 ].attributes ['refid' ] == 'greet'
89
+ assert isinstance (section [3 ], nodes .literal_block )
86
90
87
- subsection_a = section [3 ]
91
+ subsection_a = section [4 ]
88
92
assert isinstance (subsection_a , nodes .section )
89
93
90
94
assert isinstance (subsection_a [0 ], nodes .title )
91
95
assert subsection_a [0 ].astext () == 'hello'
92
96
assert isinstance (subsection_a [1 ], nodes .paragraph )
93
97
assert subsection_a [1 ].astext () == 'Greet a user.'
94
- assert isinstance (subsection_a [2 ], nodes .literal_block )
98
+ assert isinstance (subsection_a [2 ], nodes .target )
99
+ assert subsection_a [2 ].attributes ['refid' ] == 'greet-hello'
100
+ assert isinstance (subsection_a [3 ], nodes .literal_block )
95
101
# we don't need to verify the rest of this: that's done elsewhere
96
102
97
- subsection_b = section [4 ]
103
+ subsection_b = section [5 ]
98
104
assert isinstance (subsection_b , nodes .section )
99
105
100
106
assert isinstance (subsection_b [0 ], nodes .title )
101
107
assert subsection_b [0 ].astext () == 'world'
102
108
assert isinstance (subsection_b [1 ], nodes .paragraph )
103
109
assert subsection_b [1 ].astext () == 'Greet the world.'
104
- assert isinstance (subsection_b [2 ], nodes .literal_block )
110
+ assert isinstance (subsection_b [2 ], nodes .target )
111
+ assert subsection_b [2 ].attributes ['refid' ] == 'greet-world'
112
+ assert isinstance (subsection_b [3 ], nodes .literal_block )
0 commit comments