mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-21 00:22:56 +00:00
Fix RuntimeWarning: You have iterated over the result of
pkg_resources.parse_version. This is a legacy behavior Fix #504
This commit is contained in:
@ -16,7 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from gns3server.utils import force_unix_path, macaddress_to_int, int_to_macaddress
|
||||
from gns3server.utils import *
|
||||
|
||||
|
||||
def test_force_unix_path():
|
||||
@ -31,3 +31,18 @@ def test_macaddress_to_int():
|
||||
|
||||
def test_int_to_macaddress():
|
||||
assert int_to_macaddress(52228632586) == "00:0c:29:11:b0:0a"
|
||||
|
||||
|
||||
def test_parse_version():
|
||||
assert parse_version('1') == (1, 'final')
|
||||
assert parse_version('1.3') == (1, 3, 'final')
|
||||
assert parse_version('1.3.dev3') == (1, 3, 'dev', 3)
|
||||
assert parse_version('1.3a1') == (1, 3, 'a', 1)
|
||||
assert parse_version('1.3rc1') == (1, 3, 'c', 1)
|
||||
|
||||
assert parse_version('1.2.3') > parse_version('1.2.2')
|
||||
assert parse_version('1.3') > parse_version('1.2.2')
|
||||
assert parse_version('1.3') > parse_version('1.3alpha1')
|
||||
assert parse_version('1.3') > parse_version('1.3rc1')
|
||||
assert parse_version('1.3rc1') > parse_version('1.3alpha3')
|
||||
assert parse_version('1.3dev1') > parse_version('1.3rc1')
|
||||
|
Reference in New Issue
Block a user