Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:csena:branches:home:yeey:OpenWebUI
python-lockfile
convert-to-unittest.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File convert-to-unittest.patch of Package python-lockfile
diff -ur lockfile-0.12.2-orig/test/compliancetest.py lockfile-0.12.2/test/compliancetest.py --- lockfile-0.12.2-orig/test/compliancetest.py 2015-11-26 01:29:13.000000000 +0700 +++ lockfile-0.12.2/test/compliancetest.py 2020-08-16 07:58:15.176973406 +0700 @@ -1,23 +1,22 @@ import os import threading import shutil +import unittest import lockfile class ComplianceTest(object): - def __init__(self): - self.saved_class = lockfile.LockFile - def _testfile(self): """Return platform-appropriate file. Helper for tests.""" import tempfile return os.path.join(tempfile.gettempdir(), 'trash-%s' % os.getpid()) - def setup(self): - lockfile.LockFile = self.class_to_test + def setUp(self): + self.saved_class = lockfile.LockFile + lockfile.LockFile = getattr(self, 'class_to_test', None) - def teardown(self): + def tearDown(self): try: tf = self._testfile() if os.path.isdir(tf): diff -ur lockfile-0.12.2-orig/test/test_lockfile.py lockfile-0.12.2/test/test_lockfile.py --- lockfile-0.12.2-orig/test/test_lockfile.py 2015-11-26 01:29:13.000000000 +0700 +++ lockfile-0.12.2/test/test_lockfile.py 2020-08-16 07:58:49.461371422 +0700 @@ -1,3 +1,5 @@ +import unittest + import lockfile.linklockfile import lockfile.mkdirlockfile import lockfile.pidlockfile @@ -6,28 +8,28 @@ from compliancetest import ComplianceTest -class TestLinkLockFile(ComplianceTest): +class TestLinkLockFile(ComplianceTest, unittest.TestCase): class_to_test = lockfile.linklockfile.LinkLockFile -class TestSymlinkLockFile(ComplianceTest): +class TestSymlinkLockFile(ComplianceTest, unittest.TestCase): class_to_test = lockfile.symlinklockfile.SymlinkLockFile -class TestMkdirLockFile(ComplianceTest): +class TestMkdirLockFile(ComplianceTest, unittest.TestCase): class_to_test = lockfile.mkdirlockfile.MkdirLockFile -class TestPIDLockFile(ComplianceTest): +class TestPIDLockFile(ComplianceTest, unittest.TestCase): class_to_test = lockfile.pidlockfile.PIDLockFile # Check backwards compatibility -class TestLinkFileLock(ComplianceTest): +class TestLinkFileLock(ComplianceTest, unittest.TestCase): class_to_test = lockfile.LinkFileLock -class TestMkdirFileLock(ComplianceTest): +class TestMkdirFileLock(ComplianceTest, unittest.TestCase): class_to_test = lockfile.MkdirFileLock try: @@ -37,5 +39,5 @@ else: import lockfile.sqlitelockfile - class TestSQLiteLockFile(ComplianceTest): + class TestSQLiteLockFile(ComplianceTest, unittest.TestCase): class_to_test = lockfile.sqlitelockfile.SQLiteLockFile
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor