forked from nuxeo/FunkLoad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCPS340DocTest.py
More file actions
54 lines (45 loc) · 1.71 KB
/
Copy pathCPS340DocTest.py
File metadata and controls
54 lines (45 loc) · 1.71 KB
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
# (C) Copyright 2006 Nuxeo SAS <http://nuxeo.com>
# Author: Olivier Grisel [email protected]
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
"""Doctest support for CPS340TestCase
$Id$
"""
from CPS340TestCase import CPSTestCase
from FunkLoadDocTest import FunkLoadDocTest
class CPSDocTest(FunkLoadDocTest, CPSTestCase):
"""Class to use to doctest a CPS portal
>>> from CPS340DocTest import CPSDocTest
>>> cps_url = 'http://localhost:8080/cps'
>>> fl = CPSDocTest(cps_url)
>>> fl.cps_test_case_version
(3, 4, 0)
>>> fl.server_url == cps_url
True
Then you can use the CPS340TestCase API like fl.cpsLogin('manager', 'pwd').
"""
def __init__(self, server_url, debug=False, debug_level=1):
"""init CPSDocTest
server_url is the CPS server url."""
FunkLoadDocTest.__init__(self, debug=debug, debug_level=debug_level)
# FunkLoadDocTest handles the init of FunkLoadTestCase which is the
# same as CPSTestCase
self.server_url = server_url
def _test():
import doctest, CPS340DocTest
return doctest.testmod(CPS340DocTest)
if __name__ == "__main__":
_test()