mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 18:18:22 +00:00
Add test_null_get
This commit is contained in:
parent
840e34c8be
commit
531ed7324b
1 changed files with 11 additions and 0 deletions
|
@ -17,3 +17,14 @@ def test_no_renderable():
|
|||
|
||||
with pytest.raises(NotRenderableError):
|
||||
Measurement.get(console, None, console.width)
|
||||
|
||||
|
||||
def test_null_get():
|
||||
# Test negative console.width passed into get method
|
||||
assert Measurement.get(Console(width=-1), None) == Measurement(0, 0)
|
||||
# Test negative max_width passed into get method
|
||||
assert Measurement.get(Console(), None, -1) == Measurement(0, 0)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_null_get()
|
Loading…
Add table
Add a link
Reference in a new issue