test fixes

This commit is contained in:
Will McGugan 2021-02-27 19:57:28 +00:00
parent fa25b2866b
commit 6219973839
1 changed files with 13 additions and 5 deletions

View File

@ -99,16 +99,24 @@ class Padding(JupyterMixin):
_Segment = Segment
left = _Segment(" " * self.left, style) if self.left else None
right = _Segment(f'{" " * self.right}\n', style)
right = (
[_Segment(f'{" " * self.right}', style), _Segment.line()]
if self.right
else [_Segment.line()]
)
blank_line: Optional[List[Segment]] = None
if self.top:
blank_line = [_Segment(f'{" " * width}\n', style)]
yield from blank_line * self.top
for line in lines:
if left is not None:
if left:
for line in lines:
yield left
yield from line
yield right
yield from line
yield from right
else:
for line in lines:
yield from line
yield from right
if self.bottom:
blank_line = blank_line or [_Segment(f'{" " * width}\n', style)]
yield from blank_line * self.bottom