|
6 | 6 |
|
7 | 7 | import logging |
8 | 8 |
|
9 | | -from .helpers import TmuxTestCase |
10 | | - |
11 | 9 | logger = logging.getLogger(__name__) |
12 | 10 |
|
13 | 11 |
|
14 | | -class ResizeTest(TmuxTestCase): |
| 12 | +def test_resize_pane(session): |
| 13 | + """ Test Pane.resize_pane(). """ |
| 14 | + |
| 15 | + window = session.attached_window() |
| 16 | + window.rename_window('test_resize_pane') |
15 | 17 |
|
16 | | - def test_resize_pane(self): |
17 | | - """ Test Pane.resize_pane(). """ |
| 18 | + pane1 = window.attached_pane() |
| 19 | + pane1_height = pane1['pane_height'] |
| 20 | + window.split_window() |
18 | 21 |
|
19 | | - window = self.session.attached_window() |
20 | | - window.rename_window('test_resize_pane') |
| 22 | + pane1.resize_pane(height=4) |
| 23 | + assert pane1['pane_height'] != pane1_height |
| 24 | + assert int(pane1['pane_height']) == 4 |
21 | 25 |
|
22 | | - pane1 = window.attached_pane() |
23 | | - pane1_height = pane1['pane_height'] |
24 | | - window.split_window() |
| 26 | + pane1.resize_pane(height=3) |
| 27 | + assert int(pane1['pane_height']) == 3 |
25 | 28 |
|
26 | | - pane1.resize_pane(height=4) |
27 | | - assert pane1['pane_height'] != pane1_height |
28 | | - assert int(pane1['pane_height']) == 4 |
29 | 29 |
|
30 | | - pane1.resize_pane(height=3) |
31 | | - assert int(pane1['pane_height']) == 3 |
| 30 | +def test_set_height(session): |
| 31 | + window = session.new_window(window_name='test_set_height') |
| 32 | + window.split_window() |
| 33 | + pane1 = window.attached_pane() |
| 34 | + pane1_height = pane1['pane_height'] |
32 | 35 |
|
33 | | - def test_set_height(self): |
34 | | - window = self.session.new_window(window_name='test_set_height') |
35 | | - window.split_window() |
36 | | - pane1 = window.attached_pane() |
37 | | - pane1_height = pane1['pane_height'] |
| 36 | + pane1.set_height(2) |
| 37 | + assert pane1['pane_height'] != pane1_height |
| 38 | + assert int(pane1['pane_height']) == 2 |
38 | 39 |
|
39 | | - pane1.set_height(2) |
40 | | - assert pane1['pane_height'] != pane1_height |
41 | | - assert int(pane1['pane_height']) == 2 |
42 | 40 |
|
43 | | - def test_set_width(self): |
44 | | - window = self.session.new_window(window_name='test_set_width') |
45 | | - window.split_window() |
| 41 | +def test_set_width(session): |
| 42 | + window = session.new_window(window_name='test_set_width') |
| 43 | + window.split_window() |
46 | 44 |
|
47 | | - window.select_layout('main-vertical') |
48 | | - pane1 = window.attached_pane() |
49 | | - pane1_width = pane1['pane_width'] |
| 45 | + window.select_layout('main-vertical') |
| 46 | + pane1 = window.attached_pane() |
| 47 | + pane1_width = pane1['pane_width'] |
50 | 48 |
|
51 | | - pane1.set_width(10) |
52 | | - assert pane1['pane_width'] != pane1_width |
53 | | - assert int(pane1['pane_width']) == 10 |
| 49 | + pane1.set_width(10) |
| 50 | + assert pane1['pane_width'] != pane1_width |
| 51 | + assert int(pane1['pane_width']) == 10 |
54 | 52 |
|
55 | | - pane1.reset() |
| 53 | + pane1.reset() |
0 commit comments