forked from Valandur/webapi-client-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_entity_api.py
More file actions
76 lines (51 loc) · 3.7 KB
/
test_entity_api.py
File metadata and controls
76 lines (51 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# coding: utf-8
"""
Web-API
Access Sponge powered Minecraft servers through a WebAPI # Introduction This is the documentation of the various API routes offered by the WebAPI plugin. This documentation assumes that you are familiar with the basic concepts of Web API's, such as `GET`, `PUT`, `POST` and `DELETE` methods, request `HEADERS` and `RESPONSE CODES` and `JSON` data. By default this documentation can be found at http:/localhost:8080 (while your minecraft server is running) and the various routes start with http:/localhost:8080/api/v5... As a quick test try reaching the route http:/localhost:8080/api/v5/info (remember that you can only access \\\"localhost\\\" routes on the server on which you are running minecraft). This route should show you basic information about your server, like the motd and player count. # List endpoints Lots of objects offer an endpoint to list all objects (e.g. `GET: /world` to get all worlds). These endpoints return only the properties marked 'required' by default, because the list might be quite large. If you want to return ALL data for a list endpoint add the query parameter `details`, (e.g. `GET: /world?details`). > Remember that in this case the data returned by the endpoint might be quite large. # Debugging endpoints Apart from the `?details` flag you can also pass some other flags for debugging purposes. Remember that you must include the first query parameter with `?`, and further ones with `&`: `details`: Includes details for list endpoints `accept=[json/xml]`: Manually set the accept content type. This is good for browser testing, **BUT DON'T USE THIS IN PRODUCTION, YOU CAN SUPPLY THE `Accepts` HEADER FOR THAT** `pretty`: Pretty prints the data, also good for debugging in the browser. An example request might look like this: `http://localhost:8080/api/v5/world?details&accpet=json&pretty&key=MY-API-KEY` # Additional data Certain endpoints (such as `/player`, `/entity` and `/tile-entity` have additional properties which are not documented here, because the data depends on the concrete object type (eg. `Sheep` have a wool color, others do not) and on the other plugins/mods that are running on your server which might add additional data. You can also find more information in the github docs (https:/github.com/Valandur/Web-API/tree/master/docs/DATA.md) # noqa: E501
OpenAPI spec version: @version@
Contact: inithilian@gmail.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import swagger_client
from swagger_client.api.entity_api import EntityApi # noqa: E501
from swagger_client.rest import ApiException
class TestEntityApi(unittest.TestCase):
"""EntityApi unit test stubs"""
def setUp(self):
self.api = swagger_client.api.entity_api.EntityApi() # noqa: E501
def tearDown(self):
pass
def test_create_entity(self):
"""Test case for create_entity
Spawn an entity # noqa: E501
"""
pass
def test_execute_method(self):
"""Test case for execute_method
Execute a method # noqa: E501
"""
pass
def test_get_entity(self):
"""Test case for get_entity
Get entity # noqa: E501
"""
pass
def test_list_entities(self):
"""Test case for list_entities
List entities # noqa: E501
"""
pass
def test_modify_entity(self):
"""Test case for modify_entity
Modify an entity # noqa: E501
"""
pass
def test_remove_entity(self):
"""Test case for remove_entity
Destroy an entity # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()