1
0
mirror of https://github.com/CMiksche/gitea-auto-update synced 2025-12-10 16:07:23 +01:00
Files
gitea-auto-update/tests.py
Christoph Miksche c81eb967d8 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)
2019-04-20 15:42:01 +02:00

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()