mirror of
https://github.com/CMiksche/gitea-auto-update
synced 2025-12-10 16:07:23 +01:00
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)
19 lines
517 B
Python
19 lines
517 B
Python
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() |