This repository has been archived by the owner on Feb 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
test_flock.py
executable file
·63 lines (45 loc) · 1.59 KB
/
test_flock.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python
"""
Unittests for adept module
Dependencies:
- python-2.7
- python-unittest2
- python-mock
- pylint
- python-jenkins
- test_adept
"""
import sys
import unittest2 as unittest
# ref: http://www.voidspace.org.uk/python/mock/index.html
#from mock import Mock
#from mock import mock_open
#from mock import patch
import test_adept
# For test discovery all test modules must be importable from the top level
# directory of the project. No clean way to do this that doesn't depend on
# knowledge of the repo directory structure somewhere/somehow.
UUT_REL_PATH = 'kommandir/bin/'
sys.path.insert(0, UUT_REL_PATH)
# pylint doesn't count __init__ as a public method for ABCs
test_adept.TestPylint.DISABLE += ",R0903"
# main shouldn't be subject to only upper-case variable names
test_adept.TestPylint.DISABLE += ",C0103"
class TestCaseBase(test_adept.TestCaseBase):
"""Reuses essental/basic unittest plumbing from adepts unittests"""
UUT = 'flock'
def setUp(self):
super(TestCaseBase, self).setUp()
self.uut = __import__(self.UUT)
class TestPylint(test_adept.TestPylint):
"""Reuses essental pylint-plumbing from adepts unittests, for this module"""
UUT = TestCaseBase.UUT
def test_unittest_pylint(self):
"Run pylint on the unittest module itself"
self._pylintrun(__file__)
def test_uut_pylint(self):
"Run pylint on the unit under test"
self._pylintrun(self.uut.__file__)
# TODO: Actually write some tests
if __name__ == '__main__':
unittest.main(failfast=True, catchbreak=True, verbosity=2)