Merge ~adam-collard/maas:api-docs-reformat into maas:master

Proposed by Adam Collard
Status: Merged
Approved by: Adam Collard
Approved revision: 4cbe04c868c0d0b0b167691a05731beb373f72ed
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~adam-collard/maas:api-docs-reformat
Merge into: maas:master
Diff against target: 44 lines (+4/-9)
2 files modified
src/maasserver/api/doc_handler.py (+0/-1)
src/maasserver/tests/test_commands.py (+4/-8)
Reviewer Review Type Date Requested Status
Alberto Donato (community) Approve
MAAS Lander unittests Pending
Review via email: mp+397428@code.launchpad.net

Commit message

Remove redundant tocdepth from api-docs.

To post a comment you must log in.
Revision history for this message
Alberto Donato (ack) :
Revision history for this message
Alberto Donato (ack) wrote :

+1 with a nit

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
~adam-collard/maas:api-docs-reformat updated
4cbe04c... by Adam Collard

Remove unused import

Signed-off-by: Adam Collard <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maasserver/api/doc_handler.py b/src/maasserver/api/doc_handler.py
2index 6425110..9b332c7 100644
3--- a/src/maasserver/api/doc_handler.py
4+++ b/src/maasserver/api/doc_handler.py
5@@ -80,7 +80,6 @@ from maasserver.utils import build_absolute_uri
6 # the two.
7 api_doc_title = dedent(
8 """
9- :tocdepth: 3
10 .. _maas-api:
11
12 ========
13diff --git a/src/maasserver/tests/test_commands.py b/src/maasserver/tests/test_commands.py
14index ce906c9..1b98b9d 100644
15--- a/src/maasserver/tests/test_commands.py
16+++ b/src/maasserver/tests/test_commands.py
17@@ -12,7 +12,7 @@ from django.contrib.auth.models import User
18 from django.core.management import call_command
19 from django.core.management.base import CommandError
20 from requests.exceptions import RequestException
21-from testtools.matchers import AfterPreprocessing, HasLength, StartsWith
22+from testtools.matchers import AfterPreprocessing, HasLength
23
24 from apiclient.creds import convert_tuple_to_string
25 from maasserver.enum import KEYS_PROTOCOL_TYPE
26@@ -57,15 +57,11 @@ class TestCommands(MAASServerTestCase):
27 # Just check that the documentation looks all right.
28 self.assertIn("POST /MAAS/api/2.0/account/", result)
29 self.assertIn("MAAS API", result)
30- # The documentation starts with a link target: "region-controller-api".
31- # (And also a specification that the left-side table-of-contents depth
32- # should not exceed 3 levels deep.)
33- self.assertThat(
34- result[:100],
35- StartsWith(":tocdepth: 3\n.. _maas-api:"),
36+ self.assertTrue(
37+ result[:20].startswith(".. _maas-api:"),
38 )
39 # It also contains a ReST title (not indented).
40- self.assertIn("===", result[:100])
41+ self.assertIn("===", result[:20])
42
43 def test_createadmin_prompts_for_password_if_not_given(self):
44 stderr = StringIO()

Subscribers

People subscribed via source and target branches