diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-04-15 19:23:44 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-04-15 19:23:44 +0100 |
commit | 88d494d0045df84f89a01be8c7df2c195635a057 (patch) | |
tree | 58808f87957229c528df048088da93bbadd5b53f | |
parent | 82d2b7b8950a43f2055353ad9259cad6506b142e (diff) | |
download | python-ttystatus-88d494d0045df84f89a01be8c7df2c195635a057.tar.gz |
Add test for rendering variable size widgets smaller if space is constrained
-rw-r--r-- | ttystatus/status_tests.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ttystatus/status_tests.py b/ttystatus/status_tests.py index ab27ca9..ef8959a 100644 --- a/ttystatus/status_tests.py +++ b/ttystatus/status_tests.py @@ -147,3 +147,14 @@ class TerminalStatusTests(unittest.TestCase): text = self.ts._render() self.assertEqual(text, 'foob') + def test_renders_variable_size_width_according_to_space_keep_static(self): + w1 = ttystatus.Literal('foo') + w2 = ttystatus.ProgressBar('done', 'total') + w3 = ttystatus.Literal('bar') + self.ts.add(w1) + self.ts.add(w2) + self.ts.add(w3) + self.ts._m.width = 9 + text = self.ts._render() + self.assertEqual(text, 'foo---bar') + |