Code Repositories xandikos / 3a5f3ed
Document/test public API. Jelmer Vernooń≥ 2 years ago
3 changed file(s) with 61 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 API Stability
1 =============
2
3 There are currently no guarantees about Xandikos Python APIs staying the same
4 across different versions, except the following APIs:
5
6 xandikos.web.XandikosBackend(path)
7 xandikos.web.XandikosBackend.create_principal(principal, create_defaults=False)
8 xandikos.web.XandikosApp(backend, current_user_principal)
9 xandikos.web.WellknownRedirector(app, path)
10
11 If you care about stability of any other APIs, please file a bug against Xandikos.
2121
2222 def test_suite():
2323 names = [
24 'api',
2425 'caldav',
2526 'icalendar',
2627 'store',
0 # Xandikos
1 # Copyright (C) 2016-2017 Jelmer Vernooń≥ <jelmer@jelmer.uk>, et al.
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; version 3
6 # of the License or (at your option) any later version of
7 # the License.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 # MA 02110-1301, USA.
18
19 import shutil
20 import tempfile
21 import unittest
22
23 from xandikos.web import (
24 XandikosApp,
25 XandikosBackend,
26 WellknownRedirector,
27 )
28
29
30 class WebTests(unittest.TestCase):
31
32 # When changing this API, please update notes/api-stability.rst and inform
33 # vdirsyncer, who rely on this API.
34
35 def test_backend(self):
36 path = tempfile.mkdtemp()
37 try:
38 backend = XandikosBackend(path)
39 backend.create_principal('foo', create_defaults=True)
40 XandikosApp(backend, 'foo')
41 finally:
42 shutil.rmtree(path)
43
44 def test_wellknownredirector(self):
45 def app(environ, start_response):
46 pass
47 WellknownRedirector(app, '/path')