|
12 | 12 |
|
13 | 13 | from libtmux.common import ( |
14 | 14 | has_minimum_tmux_version, which, session_check_name, tmux_cmd, |
15 | | - has_version, has_gt_version, has_lt_version, get_version |
| 15 | + has_version, has_gt_version, has_lt_version, get_version, |
| 16 | + has_gte_version, has_lte_version |
16 | 17 | ) |
17 | 18 | from libtmux.exc import LibTmuxException, BadSessionName, TmuxCommandNotFound |
18 | 19 |
|
@@ -94,14 +95,35 @@ def test_has_version(): |
94 | 95 | def test_has_gt_version(): |
95 | 96 | assert has_gt_version('1.6') |
96 | 97 | assert has_gt_version('1.6b') |
| 98 | + |
97 | 99 | assert not has_gt_version('4.0') |
| 100 | + assert not has_gt_version('4.0b') |
| 101 | + |
| 102 | + |
| 103 | +def test_has_gte_version(): |
| 104 | + assert has_gte_version('1.6') |
| 105 | + assert has_gte_version('1.6b') |
| 106 | + assert has_gte_version(str(get_version())) |
| 107 | + |
| 108 | + assert not has_gte_version('4.0') |
| 109 | + assert not has_gte_version('4.0b') |
98 | 110 |
|
99 | 111 |
|
100 | 112 | def test_has_lt_version(): |
101 | 113 | assert has_lt_version('4.0a') |
102 | 114 | assert has_lt_version('4.0') |
103 | 115 |
|
104 | 116 | assert not has_lt_version('1.7') |
| 117 | + assert not has_lt_version(str(get_version())) |
| 118 | + |
| 119 | + |
| 120 | +def test_has_lte_version(): |
| 121 | + assert has_lte_version('4.0a') |
| 122 | + assert has_lte_version('4.0') |
| 123 | + assert has_lte_version(str(get_version())) |
| 124 | + |
| 125 | + assert not has_lte_version('1.7') |
| 126 | + assert not has_lte_version('1.7b') |
105 | 127 |
|
106 | 128 |
|
107 | 129 | def test_which_no_bin_found(): |
|
0 commit comments