1
0
mirror of https://github.com/CMiksche/gitea-auto-update synced 2025-12-10 07:57:23 +01:00

fix: add function to check the versions after semver

Add a function to check the two versions after the semver specification. Added some unit tests for testing the function too.

(Should fix GH-1, but wasn't fully tested yet)
This commit is contained in:
Christoph Miksche
2019-04-20 15:42:01 +02:00
parent e3e4ce3ec3
commit c81eb967d8
3 changed files with 65 additions and 27 deletions

19
tests.py Normal file
View File

@@ -0,0 +1,19 @@
import functions
import unittest
class Tests(unittest.TestCase):
def checkSimpleVersion(self):
self.assertTrue(functions.checkVersion('1.9.1', '1.9.0'))
def checkTwoIntVersion(self):
self.assertTrue(functions.checkVersion('1.10.0', '1.9.0'))
def checkFalseVersion(self):
self.assertFalse(functions.checkVersion('1.8.0', '1.9.0'))
def checkSameVersion(self):
self.assertFalse(functions.checkVersion('1.9.7', '1.9.7'))
if __name__ == '__main__':
unittest.main()