mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
File diff suppressed because one or more lines are too long
17
tests/test_app.py
Normal file
17
tests/test_app.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from textual.app import App
|
||||
|
||||
|
||||
def test_batch_update():
|
||||
"""Test `batch_update` context manager"""
|
||||
app = App()
|
||||
assert app._batch_count == 0 # Start at zero
|
||||
|
||||
with app.batch_update():
|
||||
assert app._batch_count == 1 # Increments in context manager
|
||||
|
||||
with app.batch_update():
|
||||
assert app._batch_count == 2 # Nested updates
|
||||
|
||||
assert app._batch_count == 1 # Exiting decrements
|
||||
|
||||
assert app._batch_count == 0 # Back to zero
|
||||
Reference in New Issue
Block a user