@@ -681,3 +681,55 @@ def test_compute_sizing_mode_stretch_margin_four_tuple(dim, document, comm):
681681 new_props = col ._compute_sizing_mode (root .children , {'margin' : margin })
682682
683683 assert new_props == {f'min_{ dim } ' : 115 , 'sizing_mode' : f'stretch_{ dim } ' }
684+
685+ def test_compute_sizing_mode_explicit_sizing_mode_not_inherited (document , comm ):
686+ md = Markdown ('foo' , sizing_mode = 'stretch_width' )
687+ col = Column (md , sizing_mode = 'fixed' )
688+
689+ root = col .get_root (document , comm = comm )
690+
691+ assert root .sizing_mode == 'fixed'
692+
693+ def test_compute_sizing_mode_explicit_width_policy_max_still_inherited (document , comm ):
694+ md = Markdown ('foo' , sizing_mode = 'stretch_width' )
695+ col = Column (md , width_policy = 'max' )
696+
697+ root = col .get_root (document , comm = comm )
698+
699+ assert root .sizing_mode == 'stretch_width'
700+ assert root .width_policy == 'max'
701+
702+ def test_compute_sizing_mode_explicit_width_policy_not_max_not_inherited (document , comm ):
703+ md = Markdown ('foo' , sizing_mode = 'stretch_width' )
704+ col = Column (md , width_policy = 'fixed' )
705+
706+ root = col .get_root (document , comm = comm )
707+
708+ assert root .sizing_mode is None
709+ assert root .width_policy == 'fixed'
710+
711+ def test_compute_sizing_mode_explicit_height_policy_not_max_not_inherited (document , comm ):
712+ md = Markdown ('foo' , sizing_mode = 'stretch_height' )
713+ col = Column (md , height_policy = 'fixed' )
714+
715+ root = col .get_root (document , comm = comm )
716+
717+ assert root .sizing_mode is None
718+ assert root .height_policy == 'fixed'
719+
720+ def test_compute_sizing_mode_inherited_without_explicit_sizing (document , comm ):
721+ md = Markdown ('foo' , sizing_mode = 'stretch_width' )
722+ col = Column (md )
723+
724+ root = col .get_root (document , comm = comm )
725+
726+ assert root .sizing_mode == 'stretch_width'
727+
728+ def test_compute_sizing_mode_dynamic_sizing_mode_not_inherited (document , comm ):
729+ md = Markdown ('foo' , sizing_mode = 'stretch_width' )
730+ col = Column (md )
731+ col .sizing_mode = 'fixed'
732+
733+ root = col .get_root (document , comm = comm )
734+
735+ assert root .sizing_mode == 'fixed'
0 commit comments