1
# Copyright (C) 2013 by the Free Software Foundation, Inc.
3
# This file is part of GNU Mailman.
5
# GNU Mailman is free software: you can redistribute it and/or modify it under
6
# the terms of the GNU General Public License as published by the Free
7
# Software Foundation, either version 3 of the License, or (at your option)
10
# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15
# You should have received a copy of the GNU General Public License along with
16
# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
18
"""Test the REST runner."""
20
from __future__ import absolute_import, print_function, unicode_literals
32
from mailman.testing.helpers import call_api, wait_for_webservice
33
from mailman.testing.layers import RESTLayer
37
class TestRESTRunner(unittest.TestCase):
38
"""Test the REST runner."""
42
def test_sighup_restart(self):
43
# The REST runner must survive a SIGHUP.
45
for pid in self.layer.server.runner_pids:
46
os.kill(pid, signal.SIGHUP)
48
# This should not raise an exception. The best way to assert this is
49
# to ensure that the response is valid.
50
response, json = call_api('http://localhost:9001/3.0/system')
51
self.assertEqual(json['content-location'],
52
'http://localhost:9001/3.0/system')