Rename hypervisor to compute

Fix #487
This commit is contained in:
Julien Duponchelle
2016-04-15 17:57:06 +02:00
parent 3185baff0d
commit 58d4a529d4
186 changed files with 1173 additions and 1206 deletions

View File

@ -24,19 +24,19 @@ from gns3server.web.route import Route
def test_documentation_write(tmpdir):
os.makedirs(str(tmpdir / "api/examples"))
with open(str(tmpdir / "api/examples/hypervisor_post_projectsprojectidvirtualboxvms.txt"), "w+") as f:
with open(str(tmpdir / "api/examples/compute_post_projectsprojectidvirtualboxvms.txt"), "w+") as f:
f.write("curl test")
Documentation(Route, str(tmpdir)).write()
assert os.path.exists(str(tmpdir / "api"))
assert os.path.exists(str(tmpdir / "api" / "v2" / "hypervisor"))
assert os.path.exists(str(tmpdir / "api" / "v2" / "hypervisor" / "virtualbox.rst"))
assert os.path.exists(str(tmpdir / "api" / "v2" / "hypervisor" / "virtualbox"))
assert os.path.exists(str(tmpdir / "api" / "v2" / "hypervisor" / "virtualbox" / "virtualboxvms.rst"))
with open(str(tmpdir / "api" / "v2" / "hypervisor" / "virtualbox" / "projectsprojectidvirtualboxvms.rst")) as f:
assert os.path.exists(str(tmpdir / "api" / "v2" / "compute"))
assert os.path.exists(str(tmpdir / "api" / "v2" / "compute" / "virtualbox.rst"))
assert os.path.exists(str(tmpdir / "api" / "v2" / "compute" / "virtualbox"))
assert os.path.exists(str(tmpdir / "api" / "v2" / "compute" / "virtualbox" / "virtualboxvms.rst"))
with open(str(tmpdir / "api" / "v2" / "compute" / "virtualbox" / "projectsprojectidvirtualboxvms.rst")) as f:
content = f.read()
assert "Sample session" in content
assert "literalinclude:: ../../../examples/hypervisor_post_projectsprojectidvirtualboxvms.txt" in content
assert "literalinclude:: ../../../examples/compute_post_projectsprojectidvirtualboxvms.txt" in content
assert os.path.exists(str(tmpdir / "api" / "v2" / "controller" / "hypervisor.rst"))
assert os.path.exists(str(tmpdir / "api" / "v2" / "controller" / "compute.rst"))