|
|
@ -7,6 +7,7 @@ import unittest
|
|
|
|
from check_kernel import clean_kernel_version, Version
|
|
|
|
from check_kernel import clean_kernel_version, Version
|
|
|
|
import check_kernel
|
|
|
|
import check_kernel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def patch_object(obj, function, return_value=None):
|
|
|
|
def patch_object(obj, function, return_value=None):
|
|
|
|
"""A simple replacement for unittest.mock.patch_object()
|
|
|
|
"""A simple replacement for unittest.mock.patch_object()
|
|
|
|
|
|
|
|
|
|
|
@ -17,6 +18,13 @@ def patch_object(obj, function, return_value=None):
|
|
|
|
obj.__dict__[function] = our_function
|
|
|
|
obj.__dict__[function] = our_function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Patch up unittest
|
|
|
|
|
|
|
|
if not hasattr(unittest, 'assertGreater'):
|
|
|
|
|
|
|
|
unittest.assertGreater = lambda self, a, b: self.assertTrue(a > b)
|
|
|
|
|
|
|
|
if not hasattr(unittest, 'assertLess'):
|
|
|
|
|
|
|
|
unittest.assertLess = lambda self, a, b: self.assertTrue(a < b)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CleanKernelVersionTestCase(unittest.TestCase):
|
|
|
|
class CleanKernelVersionTestCase(unittest.TestCase):
|
|
|
|
def testDebian(self):
|
|
|
|
def testDebian(self):
|
|
|
|
versions = [('3.16.7-ckt9-3~deb8u2', '3.16.7-ckt9-3~deb8u2')]
|
|
|
|
versions = [('3.16.7-ckt9-3~deb8u2', '3.16.7-ckt9-3~deb8u2')]
|
|
|
|