How to use the libtmux.common.has_gt_version function in libtmux

To help you get started, we’ve selected a few libtmux examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tmux-python / libtmux / tests / test_common.py View on Github external
def test_allows_master_version(monkeypatch):
    def mock_tmux_cmd(param):
        class Hi(object):
            stdout = ['tmux master']
            stderr = None

        return Hi()

    monkeypatch.setattr(libtmux.common, 'tmux_cmd', mock_tmux_cmd)

    assert has_minimum_version()
    assert has_gte_version(TMUX_MIN_VERSION)
    assert has_gt_version(TMUX_MAX_VERSION), "Greater than the max-supported version"
    assert (
        '%s-master' % TMUX_MAX_VERSION == get_version()
    ), "Is the latest supported version with -master appended"
github tmux-python / libtmux / tests / test_common.py View on Github external
def test_allows_next_version(monkeypatch):
    def mock_tmux_cmd(param):
        class Hi(object):
            stdout = ['tmux next-2.9']
            stderr = None

        return Hi()

    monkeypatch.setattr(libtmux.common, 'tmux_cmd', mock_tmux_cmd)

    assert has_minimum_version()
    assert has_gte_version(TMUX_MIN_VERSION)
    assert has_gt_version(TMUX_MAX_VERSION), "Greater than the max-supported version"
    assert '2.9' == get_version()
github tmux-python / libtmux / tests / test_common.py View on Github external
def test_has_gt_version():
    assert has_gt_version('1.6')
    assert has_gt_version('1.6b')

    assert not has_gt_version('4.0')
    assert not has_gt_version('4.0b')
github tmux-python / libtmux / tests / test_common.py View on Github external
def test_get_version_openbsd(monkeypatch):
    def mock_tmux_cmd(param):
        class Hi(object):
            stderr = ['tmux: unknown option -- V']

        return Hi()

    monkeypatch.setattr(libtmux.common, 'tmux_cmd', mock_tmux_cmd)
    monkeypatch.setattr(sys, 'platform', 'openbsd 5.2')
    assert has_minimum_version()
    assert has_gte_version(TMUX_MIN_VERSION)
    assert has_gt_version(TMUX_MAX_VERSION), "Greater than the max-supported version"
    assert (
        '%s-openbsd' % TMUX_MAX_VERSION == get_version()
    ), "Is the latest supported version with -openbsd appended"
github tmux-python / libtmux / tests / test_common.py View on Github external
def test_has_gt_version():
    assert has_gt_version('1.6')
    assert has_gt_version('1.6b')

    assert not has_gt_version('4.0')
    assert not has_gt_version('4.0b')
github tmux-python / libtmux / tests / test_common.py View on Github external
def test_has_gt_version():
    assert has_gt_version('1.6')
    assert has_gt_version('1.6b')

    assert not has_gt_version('4.0')
    assert not has_gt_version('4.0b')
github tmux-python / libtmux / tests / test_common.py View on Github external
def test_has_gt_version():
    assert has_gt_version('1.6')
    assert has_gt_version('1.6b')

    assert not has_gt_version('4.0')
    assert not has_gt_version('4.0b')