freeipa/ipatests/test_ipaplatform/test_tasks.py
Stanislav Laznicka b5bdd07bc5
Add absolute_import future imports
Add absolute_import from __future__ so that pylint
does not fail and to achieve python3 behavior in
python2.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2018-04-20 09:43:37 +02:00

30 lines
717 B
Python

#
# Copyright (C) 2017 FreeIPA Contributors see COPYING for license
#
from __future__ import absolute_import
from ipaplatform.tasks import tasks
def test_ipa_version():
v3 = tasks.parse_ipa_version('3.0')
assert v3.version == u'3.0'
if hasattr(v3, '_rpmvercmp'):
assert v3._rpmvercmp_func is None
v3._rpmvercmp(b'1', b'2')
assert v3._rpmvercmp_func is not None
v4 = tasks.parse_ipa_version('4.0')
assert v4.version == u'4.0'
if hasattr(v4, '_rpmvercmp'):
assert v4._rpmvercmp_func is not None
assert v3 < v4
assert v3 <= v4
assert v3 <= v3
assert v3 != v4
assert v3 == v3
assert not v3 == v4
assert v4 > v3
assert v4 >= v3