import gevent

from gevent import queue
from wal_e import channel


def test_channel_shim():
    v = tuple(int(x) for x in gevent.__version__.split('.'))

    if v >= (0, 13, 0) and v < (1, 0, 0):
        assert isinstance(channel.Channel(), queue.Queue)
    elif v >= (1, 0, 0):
        assert isinstance(channel.Channel(), queue.Channel)
    else:
        assert False, 'Unexpected version ' + gevent.__version__

import gevent

from gevent import queue
from wal_e import channel


def test_channel_shim():
    v = tuple(int(x) for x in gevent.__version__.split('.'))
    print 'Version info:', gevent.__version__, v

    if v >= (0, 13) and v < (1, 0):
        assert isinstance(channel.Channel(), queue.Queue)
    elif v >= (1, 0):
        assert isinstance(channel.Channel(), queue.Channel)
    else:
        assert False, 'Unexpected version ' + gevent.__version__

Fix channel shim test for gevent 1.0.0
Fix channel shim test for gevent 1.0.0

Gevent 1.0 specifies this as its version, not 1.0.0, breaking the
comparison spuriously if one has version 1.0 installed exactly.
