source: products/quintagroup.gdocs.spreadsheet/trunk/quintagroup/gdocs/spreadsheet/tests/test_doctest.py @ 2757

Last change on this file since 2757 was 2757, checked in by liebster, 12 years ago

Add doctests of context and adapter

File size: 1.7 KB
Line 
1import unittest
2import doctest
3
4import zope.component
5from Testing import ZopeTestCase as ztc
6
7from quintagroup.gauth.interfaces import IGAuthUtility
8import quintagroup.gdocs.spreadsheet.content.gspreadsheet as gspreadsheet
9from quintagroup.gdocs.spreadsheet.tests import base
10
11
12def setUp(test):
13
14    """substitution using the adapter services gdata"""
15    import quintagroup.gdocs.spreadsheet.tests.adapters
16
17
18def tearDown(test):
19    """This is the companion to setUp - it can be used to clean up the
20    test environment after each test.
21    """
22
23def test_suite():
24    return unittest.TestSuite([
25
26        # Demonstrate the main content types
27        ztc.ZopeDocFileSuite(
28            'README.txt', package='quintagroup.gdocs.spreadsheet',
29            test_class=base.FunctionalTestCase,
30            optionflags=doctest.REPORT_ONLY_FIRST_FAILURE |
31                doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS,
32            setUp=setUp,
33            tearDown=tearDown,
34            ),
35        ztc.ZopeDocFileSuite('tests/test_adapters.txt',
36            package='quintagroup.gdocs.spreadsheet',
37            test_class=base.FunctionalTestCase,
38            optionflags=doctest.REPORT_ONLY_FIRST_FAILURE |
39                doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS,
40            setUp=setUp,
41            tearDown=tearDown,
42            ),
43        ztc.ZopeDocFileSuite('tests/test_context.txt',
44            package='quintagroup.gdocs.spreadsheet',
45            test_class=base.FunctionalTestCase,
46            optionflags=doctest.REPORT_ONLY_FIRST_FAILURE |
47                doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS,
48            setUp=setUp,
49            tearDown=tearDown,
50            ),
51
52        ])
53
54if __name__ == '__main__':
55    unittest.main(defaultTest='test_suite')
Note: See TracBrowser for help on using the repository browser.