MCPcopy Index your code
hub / github.com/docker/docker-py / test_compare_versions

Function test_compare_versions

tests/unit/utils_test.py:647–660  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

645
646
647def test_compare_versions():
648 assert compare_version('1.0', '1.1') == 1
649 assert compare_version('1.10', '1.1') == -1
650 assert compare_version('1.10', '1.10') == 0
651 assert compare_version('1.10.0', '1.10.1') == 1
652 assert compare_version('1.9', '1.10') == 1
653 assert compare_version('1.9.1', '1.10') == 1
654 # Test comparison helpers
655 assert version_lt('1.0', '1.27')
656 assert version_gte('1.27', '1.20')
657 # Test zero-padding
658 assert compare_version('1', '1.0') == 0
659 assert compare_version('1.10', '1.10.1') == 1
660 assert compare_version('1.10.0', '1.10') == 0

Callers

nothing calls this directly

Calls 3

compare_versionFunction · 0.90
version_ltFunction · 0.90
version_gteFunction · 0.90

Tested by

no test coverage detected