mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Build doc support controller
This commit is contained in:
194 files changed
+1259
-724
No files matched your search
@@ -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"
|
||||
|
||||
@@ -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"))
|
||||
|
||||
Reference in new issue
Block a user