File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def representer(dumper, data):
2828 return data .node
2929
3030
31- class RoundTripLoader (yaml .SafeLoader ):
31+ class RoundTripLoader (yaml .Loader ):
3232 pass
3333
3434
Original file line number Diff line number Diff line change @@ -184,6 +184,22 @@ def test_round_trip(self):
184184 '- baz:\n option: !ENV [variable, default]\n ' )
185185 self .assertEqual (self .out .getvalue (), expected )
186186
187+ def test_python_tag (self ):
188+ cfg = 'plugins:\n - foo:\n option: !!python/none'
189+ with mock .patch ('builtins.open' ,
190+ mock_open_files ({'mkdocs.yml' : cfg })), \
191+ mock .patch ('mike.mkdocs_utils.NamedTemporaryFile' ,
192+ return_value = self .out ), \
193+ mock .patch ('os.remove' ) as mremove :
194+ with mkdocs_utils .inject_plugin ('mkdocs.yml' ) as f :
195+ self .assertEqual (f , self .out .name )
196+ newcfg = yaml .safe_load (self .out .getvalue ())
197+ mremove .assert_called_once ()
198+
199+ self .assertEqual (newcfg , {'plugins' : [
200+ 'mike' , {'foo' : {'option' : None }},
201+ ]})
202+
187203 def test_inherit (self ):
188204 main_cfg = 'INHERIT: mkdocs-base.yml\n plugins:\n foo: {}\n '
189205 base_cfg = 'plugins:\n bar: {}\n '
You can’t perform that action at this time.
0 commit comments