forked from nuxeo/FunkLoad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunkLoadDocTest.py
More file actions
69 lines (60 loc) · 2.01 KB
/
Copy pathFunkLoadDocTest.py
File metadata and controls
69 lines (60 loc) · 2.01 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# (C) Copyright 2006 Nuxeo SAS <http://nuxeo.com>
# Author: bdelbosc@nuxeo.com
#
# 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.
#
"""FunkLoad doc test
$Id$
"""
from __future__ import absolute_import
import os
from tempfile import gettempdir
from .FunkLoadTestCase import FunkLoadTestCase
from . import PatchWebunit
class FunkLoadDocTest(FunkLoadTestCase):
"""Class to use in doctest.
>>> from FunkLoadDocTest import FunkLoadDocTest
>>> fl = FunkLoadDocTest()
>>> ret = fl.get('http://localhost')
>>> ret.code
200
>>> 'HTML' in ret.body
True
"""
def __init__(self, debug=False, debug_level=1):
"""Initialise the test case."""
class Dummy:
pass
option = Dummy()
option.ftest_sleep_time_max = .001
option.ftest_sleep_time_min = .001
if debug:
option.ftest_log_to = 'console file'
if debug_level:
option.debug_level = debug_level
else:
option.ftest_log_to = 'file'
tmp_path = gettempdir()
option.ftest_log_path = os.path.join(tmp_path, 'fl-doc-test.log')
option.ftest_result_path = os.path.join(tmp_path, 'fl-doc-test.xml')
FunkLoadTestCase.__init__(self, 'runTest', option)
def runTest(self):
"""FL doctest"""
return
def _test():
import doctest, FunkLoadDocTest
return doctest.testmod(FunkLoadDocTest)
if __name__ == "__main__":
_test()