added api tests for de
fixed getMeteoroids call in api
This commit is contained in:
parent
9e89123e92
commit
9b3c8e5b7f
2 changed files with 25 additions and 2 deletions
|
@ -20,7 +20,7 @@ API_URL_GET_OP = API_URL + "getOp"
|
||||||
API_URL_GET_GOAL = API_URL + "getGoal"
|
API_URL_GET_GOAL = API_URL + "getGoal"
|
||||||
API_URL_GET_ITEMS = API_URL + "getItems"
|
API_URL_GET_ITEMS = API_URL + "getItems"
|
||||||
API_URL_GET_SCORES = API_URL + "getScores"
|
API_URL_GET_SCORES = API_URL + "getScores"
|
||||||
API_URL_GET_METEOROID = API_URL + "getMeteoroid"
|
API_URL_GET_METEOROID = API_URL + "getMeteoroids"
|
||||||
|
|
||||||
|
|
||||||
class Seeding:
|
class Seeding:
|
||||||
|
|
25
test.py
25
test.py
|
@ -2,8 +2,9 @@
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import os
|
import os
|
||||||
os.environ["API_URL"] = "http://192.168.0.7:5000/"
|
os.environ["API_URL"] = "http://127.0.0.1:5000/"
|
||||||
from compLib.Api import Seeding
|
from compLib.Api import Seeding
|
||||||
|
from compLib.Api import DoubleElim
|
||||||
|
|
||||||
|
|
||||||
class TestApiServer(unittest.TestCase):
|
class TestApiServer(unittest.TestCase):
|
||||||
|
@ -34,5 +35,27 @@ class TestApiServer(unittest.TestCase):
|
||||||
print(code)
|
print(code)
|
||||||
|
|
||||||
|
|
||||||
|
class TestApiServerDoubleElim(unittest.TestCase):
|
||||||
|
def test_all(self):
|
||||||
|
ret, code = DoubleElim.get_goal()
|
||||||
|
print(ret)
|
||||||
|
print(code)
|
||||||
|
ret, code = DoubleElim.get_items()
|
||||||
|
print(ret)
|
||||||
|
print(code)
|
||||||
|
ret, code = DoubleElim.get_scores()
|
||||||
|
print(ret)
|
||||||
|
print(code)
|
||||||
|
ret, code = DoubleElim.get_opponent()
|
||||||
|
print(ret)
|
||||||
|
print(code)
|
||||||
|
ret, code = DoubleElim.get_position()
|
||||||
|
print(ret)
|
||||||
|
print(code)
|
||||||
|
ret, code = DoubleElim.get_meteoroids()
|
||||||
|
print(ret)
|
||||||
|
print(code)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Reference in a new issue