File: testing.py

package info (click to toggle)
task 2.5.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,588 kB
  • ctags: 8,723
  • sloc: cpp: 36,161; python: 11,324; perl: 8,697; ansic: 7,400; sh: 673; makefile: 19
file content (33 lines) | stat: -rw-r--r-- 945 bytes parent folder | download | duplicates (4)
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
# -*- coding: utf-8 -*-

import unittest
import sys
from .utils import TASKW_SKIP, TASKD_SKIP
from .taskd import Taskd


class BaseTestCase(unittest.TestCase):
    def tap(self, out):
        sys.stderr.write("--- tap output start ---\n")
        for line in out.splitlines():
            sys.stderr.write(line + '\n')
        sys.stderr.write("---  tap output end  ---\n")


@unittest.skipIf(TASKW_SKIP, "TASKW_SKIP set, skipping task tests.")
class TestCase(BaseTestCase):
    """Automatically skips tests if TASKW_SKIP is present in the environment
    """
    pass


@unittest.skipIf(TASKD_SKIP, "TASKD_SKIP set, skipping taskd tests.")
@unittest.skipIf(Taskd.not_available(), "Taskd binary not available at '{0}'"
                                        .format(Taskd.DEFAULT_TASKD))
class ServerTestCase(BaseTestCase):
    """Automatically skips tests if TASKD_SKIP is present in the environment
    """
    pass


# vim: ai sts=4 et sw=4