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:
19
tests.py
Normal file
19
tests.py
Normal 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()
|
||||
Reference in New Issue
Block a user