Skip to content

Commit

Permalink
Modifying bacpypes version tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianTremblay committed Feb 4, 2020
1 parent e7edf32 commit ad2f063
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_0BacpypesVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@


def test_BacpypesVersion():
"""
The version format gives 3 parts and I would want for example
17.5 being smaller than 17.100
I'll trick the numbers in a way that will cover "most cases"
Counting patch divided by 1000 should be enough.
For comparison, 17.5 becomes 17.005
"""
maj, minor, patch = bacpypes.__version__.split(".")
assert float(maj) == 0
assert float(minor) == 17
assert float(patch) >= 5
version = float(maj) * 1000000 + float(minor) + float(patch)/1000
assert version >= 17.005

0 comments on commit ad2f063

Please sign in to comment.