1
# -*- coding: utf-8 -*-
2
# -----------------------------------------------------------------------------
3
# Getting Things GNOME! - a personal organizer for the GNOME desktop
4
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
6
# This program is free software: you can redistribute it and/or modify it under
7
# the terms of the GNU General Public License as published by the Free Software
8
# Foundation, either version 3 of the License, or (at your option) any later
11
# This program is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16
# You should have received a copy of the GNU General Public License along with
17
# this program. If not, see <http://www.gnu.org/licenses/>.
18
# -----------------------------------------------------------------------------
20
""" Tests for the documentation. """
31
class TestApiDocs(unittest.TestCase):
32
""" Test if the documentation still builds. """
34
def test_pydoctor(self):
35
if int(subprocess.call(['which', 'pydoctor'], stdout=subprocess.PIPE)):
36
# if no pydoctor is present, abort the test w/out giving error
38
GTG_basedir = os.path.dirname(GTG.__file__)
39
api_dir = os.path.join(GTG_basedir, '..', 'tmp',
40
'test_build_api-' + str(uuid.uuid4()))
41
if not os.path.isdir(api_dir):
44
'--add-package', GTG_basedir,
46
'--html-output=' + api_dir,
48
'--project-url=http://gtg.fritalk.com/']
49
# we suppress printing of errors to keep a clean output
50
assert(int(subprocess.call(args,
51
stdout=subprocess.PIPE,
52
stderr=subprocess.PIPE)) == 0)
53
shutil.rmtree(api_dir)
57
return unittest.TestLoader().loadTestsFromTestCase(TestApiDocs)