mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-19 14:58:07 +00:00
Drop unused endpoint POST /version on compute
This commit is contained in:
parent
72fe5d3489
commit
19e6d956df
@ -33,17 +33,3 @@ class VersionHandler:
|
||||
config = Config.instance()
|
||||
local_server = config.get_section_config("Server").getboolean("local", False)
|
||||
response.json({"version": __version__, "local": local_server})
|
||||
|
||||
@Route.post(
|
||||
r"/version",
|
||||
description="Check if version is the same as the server",
|
||||
output=VERSION_SCHEMA,
|
||||
input=VERSION_SCHEMA,
|
||||
status_codes={
|
||||
200: "Same version",
|
||||
409: "Invalid version"
|
||||
})
|
||||
def check_version(request, response):
|
||||
if request.json["version"] != __version__:
|
||||
raise HTTPConflict(text="Client version {} differs with server version {}".format(request.json["version"], __version__))
|
||||
response.json({"version": __version__})
|
||||
|
@ -32,30 +32,3 @@ def test_version_output(http_compute):
|
||||
response = http_compute.get('/version', example=True)
|
||||
assert response.status == 200
|
||||
assert response.json == {'local': True, 'version': __version__}
|
||||
|
||||
|
||||
def test_version_input(http_compute):
|
||||
query = {'version': __version__}
|
||||
response = http_compute.post('/version', query, example=True)
|
||||
assert response.status == 200
|
||||
assert response.json == {'version': __version__}
|
||||
|
||||
|
||||
def test_version_invalid_input(http_compute):
|
||||
query = {'version': "0.4.2"}
|
||||
response = http_compute.post('/version', query)
|
||||
assert response.status == 409
|
||||
assert response.json == {'message': 'Client version 0.4.2 differs with server version {}'.format(__version__),
|
||||
'status': 409}
|
||||
|
||||
|
||||
def test_version_invalid_input_schema(http_compute):
|
||||
query = {'version': "0.4.2", "bla": "blu"}
|
||||
response = http_compute.post('/version', query)
|
||||
assert response.status == 400
|
||||
|
||||
|
||||
def test_version_invalid_json(http_compute):
|
||||
query = "BOUM"
|
||||
response = http_compute.post('/version', query, raw=True)
|
||||
assert response.status == 400
|
||||
|
Loading…
Reference in New Issue
Block a user