Build doc support controller

This commit is contained in:
Julien Duponchelle committed 2016-03-04 17:50:17 +01:00
1 parent 0921df520c
commit e4b12f49d1
194 files changed
+1259 -724

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ def test_server_create(server, controller):
"user": "julien",
"password": "secure"
}
response = server.post("/servers", params)
response = server.post("/servers", params, example=True)
assert response.status == 201
assert response.route == "/servers"
assert response.json["user"] == "julien"
+9 -6
View File
@@ -30,11 +30,14 @@ def test_documentation_write(tmpdir):
Documentation(Route, str(tmpdir)).write()
assert os.path.exists(str(tmpdir / "api"))
assert os.path.exists(str(tmpdir / "api" / "v1"))
assert os.path.exists(str(tmpdir / "api" / "v1" / "virtualbox.rst"))
assert os.path.exists(str(tmpdir / "api" / "v1" / "virtualbox"))
assert os.path.exists(str(tmpdir / "api" / "v1" / "virtualbox" / "virtualboxvms.rst"))
with open(str(tmpdir / "api" / "v1" / "virtualbox" / "projectsprojectidvirtualboxvms.rst")) as f:
assert os.path.exists(str(tmpdir / "api" / "v1" / "server"))
assert os.path.exists(str(tmpdir / "api" / "v1" / "server" / "virtualbox.rst"))
assert os.path.exists(str(tmpdir / "api" / "v1" / "server" / "virtualbox"))
assert os.path.exists(str(tmpdir / "api" / "v1" / "server" / "virtualbox" / "virtualboxvms.rst"))
with open(str(tmpdir / "api" / "v1" / "server" / "virtualbox" / "projectsprojectidvirtualboxvms.rst")) as f:
content = f.read()
assert "Sample session" in content
assert "literalinclude:: ../../examples/post_projectsprojectidvirtualboxvms.txt" in content
assert "literalinclude:: ../../../examples/post_projectsprojectidvirtualboxvms.txt" in content
assert os.path.exists(str(tmpdir / "api" / "v1" / "controller" / "server.rst"))