Completed
Push — master ( da3b73...3279ec )
by Kenny
01:17
created

tests.TestPlumd   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %
Metric Value
dl 0
loc 25
rs 10
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A TestPlumd.run_tests() 0 10 2
A TestPlumd.initialize_options() 0 4 1
A TestPlumd.finalize_options() 0 5 1
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
4
"""
5
test_plumd
6
----------------------------------
7
8
Tests for `plumd` module.
9
"""
10
11
from setuptools.command.test import test as TestCommand
12
import sys
13
14
15
class TestPlumd(TestCommand):
16
    """Unit tests currently broken/not created. todo."""
17
    user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
18
19
    def initialize_options(self):
20
        """Broken. todo."""
21
        TestCommand.initialize_options(self)
22
        self.tox_args = None
23
24
    def finalize_options(self):
25
        """Broken. todo."""
26
        TestCommand.finalize_options(self)
27
        self.test_args = []
28
        self.test_suite = True
29
30
    def run_tests(self):
31
        """Broken. todo."""
32
        #import here, cause outside the eggs aren't loaded
33
        import tox
34
        import shlex
35
        args = self.tox_args
36
        if args:
37
            args = shlex.split(self.tox_args)
38
        errno = tox.cmdline(args=args)
39
        sys.exit(errno)
40
41
42
if __name__ == '__main__':
43
    import sys
44
    sys.exit(unittest.main())
45