~bertrand-rousseau/gtg/new-task-list-layout

« back to all changes in this revision

Viewing changes to GTG/tests/test_apidocs.py

  • Committer: Bertrand Rousseau
  • Date: 2012-07-13 17:24:28 UTC
  • mfrom: (1178.1.28 trunk)
  • mto: (1178.1.30 trunk)
  • mto: This revision was merged to the branch mainline in revision 1183.
  • Revision ID: bertrand.rousseau@gmail.com-20120713172428-ou3ic646fccov41d
Merge with trunk. Fixes conflict with CHANGELOG.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
# this program.  If not, see <http://www.gnu.org/licenses/>.
18
18
# -----------------------------------------------------------------------------
19
19
 
20
 
"""Tests for the documentation."""
 
20
""" Tests for the documentation. """
21
21
 
22
22
import unittest
23
23
 
28
28
import uuid
29
29
 
30
30
 
31
 
 
32
31
class TestApiDocs(unittest.TestCase):
33
 
    """Test if the documentation still builds."""
 
32
    """ Test if the documentation still builds. """
34
33
 
35
 
    
36
34
    def test_pydoctor(self):
37
 
        if int(subprocess.call(['which', 'pydoctor'], stdout = subprocess.PIPE)):
 
35
        if int(subprocess.call(['which', 'pydoctor'], stdout=subprocess.PIPE)):
38
36
            #if no pydoctor is present, abort the test w/out giving error
39
37
            return
40
38
        GTG_basedir = os.path.dirname(GTG.__file__)
42
40
                               'test_build_api-' + str(uuid.uuid4()))
43
41
        if not os.path.isdir(api_dir):
44
42
            os.makedirs(api_dir)
45
 
        args = ['pydoctor', 
 
43
        args = ['pydoctor',
46
44
                '--add-package', GTG_basedir,
47
45
                '--make-html',
48
 
                '--html-output=' + api_dir , 
 
46
                '--html-output=' + api_dir,
49
47
                '--project-name=GTG',
50
48
                '--project-url=http://gtg.fritalk.com/']
51
49
        #we suppress printing of errors to keep a clean output
52
50
        assert(int(subprocess.call(args,
53
51
                                   stdout = subprocess.PIPE,
54
 
                                   stderr = subprocess.PIPE,)) == 0)
 
52
                                   stderr = subprocess.PIPE)) == 0)
55
53
        shutil.rmtree(api_dir)
56
54
 
 
55
 
57
56
def test_suite():
58
57
    return unittest.TestLoader().loadTestsFromTestCase(TestApiDocs)