def test_unlock_research(self): """Test the unlock_research function.""" civ = Civilisation("myCiv", grid, logger) civ.science = 50 civ.unlock_research(1) self.assertEqual(civ._tree._nodes[1].unlocked, True)
def test_upgrade_unit(self): """Test the upgrade_unit method.""" civ = Civilisation("myCiv", grid, logger) civ.unlock_research(3) hextile = Hex(0, 0, 0) archer = Archer(1, 1, "myCiv", hextile) archer.actions = 2 civ.upgrade_unit(archer) self.assertEqual(archer.level, 2) self.assertEqual(archer.actions, 1)