File: fns.py.in

package info (click to toggle)
pydb 1.19-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,952 kB
  • ctags: 1,412
  • sloc: python: 3,065; perl: 2,479; sh: 586; makefile: 555; lisp: 265; ansic: 16
file content (32 lines) | stat: -rw-r--r-- 1,022 bytes parent folder | download
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
#!@PYTHON@ -t
# $Id: fns.py.in,v 1.1 2006/09/21 09:45:51 rockyb Exp $ -*- Python -*-

# This unit test doesn't use any of the debugger code. It is meant solely
# to test the connection classes.

import os, sys, thread, time, unittest

top_builddir = "@top_builddir@"
if top_builddir[-1] != os.path.sep:
    top_builddir += os.path.sep
sys.path.insert(0, os.path.join(top_builddir, 'pydb'))
top_srcdir = "@top_srcdir@"
if top_srcdir[-1] != os.path.sep:
    top_srcdir += os.path.sep
sys.path.insert(0, os.path.join(top_srcdir, 'pydb'))

import fns

class TestFns(unittest.TestCase):

    def test(self):
       """Test various routines in fns.py"""
       self.assertEqual(fns.show_onoff(True), 'on')
       self.assertEqual(fns.show_onoff(False), 'off')
       self.assertEqual( fns.printf(31, "/o"), '037')
       self.assertEqual( fns.printf(31, "/t"), '00011111')
       self.assertEqual( fns.printf(33, "/c"), '!')
       self.assertEqual( fns.printf(33, "/x"), '0x21')

if __name__ == '__main__':
    unittest.main()