File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -408,14 +408,17 @@ def get_version():
408
408
If tmux is built from git master, the version returned will be the latest
409
409
version appended with -master, e.g. ``2.4-master``.
410
410
411
+ If using OpenBSD's base system tmux, the version will have ``-openbsd``
412
+ appended to the latest version, e.g. ``2.4-openbsd``.
413
+
411
414
:returns: tmux version
412
415
:rtype: :class:`distutils.version.LooseVersion`
413
416
"""
414
417
proc = tmux_cmd ('-V' )
415
418
if proc .stderr :
416
419
if proc .stderr [0 ] == 'tmux: unknown option -- V' :
417
420
if sys .platform .startswith ("openbsd" ): # openbsd has no tmux -V
418
- return LooseVersion (TMUX_MAX_VERSION )
421
+ return LooseVersion ('%s-openbsd' % TMUX_MAX_VERSION )
419
422
raise exc .LibTmuxException (
420
423
'libtmux supports tmux %s and greater. This system'
421
424
' is running tmux 1.3 or earlier.' % TMUX_MIN_VERSION
Original file line number Diff line number Diff line change @@ -45,7 +45,14 @@ class Hi(object):
45
45
return Hi ()
46
46
monkeypatch .setattr (libtmux .common , 'tmux_cmd' , mock_tmux_cmd )
47
47
monkeypatch .setattr (sys , 'platform' , 'openbsd 5.2' )
48
- assert get_version () == LooseVersion (TMUX_MAX_VERSION )
48
+ assert has_minimum_version ()
49
+ assert has_gte_version (TMUX_MIN_VERSION )
50
+ assert has_gt_version (TMUX_MAX_VERSION ), (
51
+ "Greater than the max-supported version"
52
+ )
53
+ assert '%s-openbsd' % TMUX_MAX_VERSION == get_version (), (
54
+ "Is the latest supported version with -openbsd appended"
55
+ )
49
56
50
57
51
58
def test_get_version_too_low (monkeypatch ):
You can’t perform that action at this time.
0 commit comments