mirror of
https://github.com/CMiksche/gitea-auto-update
synced 2025-12-10 16:07:23 +01:00
Update the README.md and change the name in the files from "Gitea Remote Updater" to "Gitea Auto Updater" because the script should be run on the local system.
36 lines
1020 B
Python
36 lines
1020 B
Python
'''
|
|
Gitea Auto Updater
|
|
|
|
Copyright 2019 The Gitea-Auto-Update Authors
|
|
All rights reserved.
|
|
|
|
License: GNU General Public License
|
|
'''
|
|
import functions
|
|
import unittest
|
|
|
|
class Tests(unittest.TestCase):
|
|
|
|
def testSimpleVersion(self):
|
|
self.assertTrue(functions.checkVersion('1.9.1', '1.9.0'))
|
|
|
|
def testTwoIntVersion(self):
|
|
self.assertTrue(functions.checkVersion('1.10.0', '1.9.0'))
|
|
|
|
def testFalseVersion(self):
|
|
self.assertFalse(functions.checkVersion('1.8.0', '1.9.0'))
|
|
|
|
def testSameVersion(self):
|
|
self.assertFalse(functions.checkVersion('1.9.7', '1.9.7'))
|
|
|
|
def testInt(self):
|
|
self.assertTrue(functions.checkVersion('9', '8'))
|
|
|
|
def testSuffix(self):
|
|
self.assertTrue(functions.checkVersion('1.9.0+dev-264-g8de76b6e6', '1.8.0'))
|
|
|
|
def testParseFileVersion(self):
|
|
self.assertEqual(functions.parseFileVersion('Gitea version 1.8.1 built with go1.12.2 : bindata, sqlite, sqlite_unlock_notify'), '1.8.1')
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main() |