-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add version module that allows to compare versions in python
- Loading branch information
Showing
4 changed files
with
83 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python3 | ||
"""Unittests for python version module""" | ||
|
||
import unittest | ||
|
||
from podio import version | ||
from podio import __version__ | ||
|
||
|
||
class TestVersion(unittest.TestCase): | ||
"""General unittests for the python bindings of Version""" | ||
|
||
def test_build_version(self): | ||
"""Make sure that the build version is set consistently (i.e. configured | ||
correctly)""" | ||
self.assertEqual(version.build_version, version.Version(__version__)) | ||
|
||
def test_version_comparison(self): | ||
"""Make sure that version comparisons work""" | ||
v1 = version.Version(1, 2, 3) | ||
v2 = version.Version("0.4.2") | ||
self.assertTrue(v1 > v2) | ||
|
||
v3 = version.Version("1.2.3") | ||
self.assertEqual(v3, v1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters