File: README

package info (click to toggle)
piuparts 0.62
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 1,692 kB
  • sloc: python: 6,823; sh: 2,194; makefile: 126
file content (28 lines) | stat: -rw-r--r-- 657 bytes parent folder | download | duplicates (9)
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
To get discovered by nosetests the python files in this directory must be named
test_<sourcefile>.py.

The test case classes should be named 'NameOfTheClassUnderTestTests' and the
test functions should be named 'test_functionundertest_expected_bahavior' e.g.:

# foobar.py
-----
class FooBar(object):
    def baz(self):
        return 'baz
-----

# tests/test_foobar.py
-----
class FooBarTests(unittest.Testcase):

    def setUp(self):
        self.fb = FooBar()

    def test_baz_should_return_baz(self):
        ret_val = self.fb.baz()
        self.assertEqual(ret_val, 'baz')
-----


Use pymox as mocking framework if needed.
apt-get install python-mox3