This repository has been archived on 2025-06-01. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
compLIB/client_s2/test.py
DuSack1220 c325a2c7c2 added unittest for seeding api
added get_material_deliveries to seeding api
started working on de api test
2022-10-01 17:37:24 +02:00

36 lines
1.3 KiB
Python

import os
import unittest
import compLib.Seeding as Seeding
import compLib.Api as SeedingApi
import compLib.DoubleElimination as De
class SeedingTest(unittest.TestCase):
def test_basic_seed(self):
gamestate = Seeding.Gamestate(0)
self.assertEqual(gamestate.seed, 0)
self.assertEqual(gamestate.heu_color, 1)
self.assertEqual(gamestate.get_heuballen(), 1)
self.assertEqual(gamestate.get_logistic_plan(),
[12, 13, 10, 13, 12, 10, 11, 10, 12, 11, 12, 13, 10, 12, 10, 11, 13, 11, 13, 11, 12])
self.assertEqual(gamestate.get_material_deliveries(), [[3, 1], [0, 3], [3, 1], [3, 1]])
class SeedingApiTest(unittest.TestCase):
def test_api_seeding(self):
gamestate = Seeding.Gamestate(0)
seeding_api = SeedingApi.Seeding()
self.assertEqual(seeding_api.get_heuballen(), gamestate.get_heuballen())
self.assertEqual(seeding_api.get_logistic_plan(), gamestate.get_logistic_plan())
#self.assertEqual(seeding_api.get_material_deliveries(), gamestate.get_material_deliveries())
class DeApiTest(unittest.TestCase):
def test_api_de(self):
de = De.DoubleElim()
print(de.get_goal())
#self.assertEqual(de.get_goal(), )
if __name__ == '__main__':
unittest.main()