
import unittest

import os
os.environ["API_URL"] = "http://127.0.0.1:5000/"
from compLib.Api import Seeding
from compLib.Api import DoubleElim


class TestApiServer(unittest.TestCase):
    def test_all(self):
        ret, code = Seeding.get_garbage()
        print(ret)
        print(code)
        ret, code = Seeding.get_delivery()
        print(ret)
        print(code)
        ret, code = Seeding.get_material()
        print(ret)
        print(code)
        ret, code = Seeding.list_cargo()
        print(ret)
        print(code)
        ret, code = Seeding.get_cargo("green")
        print(ret)
        print(code)
        ret, code = Seeding.get_cargo("yellow")
        print(ret)
        print(code)
        ret, code = Seeding.get_cargo("blue")
        print(ret)
        print(code)
        ret, code = Seeding.get_cargo("red")
        print(ret)
        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__':
    unittest.main()
