diff --git a/src/pygamecfg/game_cod4_gungame.py b/src/pygamecfg/game_cod4_gungame.py index cfe9c8f..499b1cf 100644 --- a/src/pygamecfg/game_cod4_gungame.py +++ b/src/pygamecfg/game_cod4_gungame.py @@ -214,7 +214,7 @@ class GameOption_COD4_GunGame_remove_turrets(GameOption_COD4_GunGame): @GameOptions_Factory_Register class GameOption_COD4_GunGame_second_weapon(GameOption_COD4_GunGame): - TValueType = OptionType.OT_INTEGER + TValueType = OptionType.OT_STRING szOptionName: str = "second_weapon" szKeyName: str = "gg_second_weapon" bDblQuoted: bool = True @@ -225,7 +225,7 @@ class GameOption_COD4_GunGame_second_weapon(GameOption_COD4_GunGame): @GameOptions_Factory_Register class GameOption_COD4_GunGame_second_weapon_levels(GameOption_COD4_GunGame): - TValueType = OptionType.OT_INTEGER + TValueType = OptionType.OT_STRING szOptionName: str = "second_weapon_levels" szKeyName: str = "gg_second_weapon_levels" bDblQuoted: bool = True @@ -236,7 +236,7 @@ class GameOption_COD4_GunGame_second_weapon_levels(GameOption_COD4_GunGame): @GameOptions_Factory_Register class GameOption_COD4_GunGame_weapon_sequence(GameOption_COD4_GunGame): - TValueType = OptionType.OT_INTEGER + TValueType = OptionType.OT_STRING szOptionName: str = "weapon_sequence" szKeyName: str = "gg_weapon_sequence" bDblQuoted: bool = True diff --git a/test/test_cod4.py b/test/test_cod4.py index dd8bc4b..c90dc03 100644 --- a/test/test_cod4.py +++ b/test/test_cod4.py @@ -7,18 +7,16 @@ # work. If not, see . import unittest -from os import linesep, path, chdir +from os import path, chdir from io import StringIO from contextlib import redirect_stdout, redirect_stderr from pathlib import Path -import glob import shutil from src import pygamecfg from src.pygamecfg.__main__ import fct_main testdir_path = Path(__file__).parent.resolve() -chdir(testdir_path.parent.resolve()) class Testtest_cod4(unittest.TestCase): @@ -26,14 +24,15 @@ class Testtest_cod4(unittest.TestCase): self.CleanTmp() def setUp(self) -> None: + chdir(testdir_path.parent.resolve()) self.CleanTmp() + shutil.copytree(testdir_path / "data", testdir_path / "tmp") + print("======================") def CleanTmp(self): # remove any file in tmp dir, except .keep if path.exists(testdir_path / "tmp"): shutil.rmtree(testdir_path / "tmp") - shutil.copytree(testdir_path / "data", testdir_path / "tmp") - print("======================") def test_normal_READ_sv_maxclients(self): with redirect_stdout(StringIO()) as capted_stdout, redirect_stderr(StringIO()) as capted_stderr: diff --git a/test/test_gen.py b/test/test_gen.py index faad99f..3aa8250 100644 --- a/test/test_gen.py +++ b/test/test_gen.py @@ -7,14 +7,22 @@ # work. If not, see . import unittest +from os import chdir from io import StringIO from contextlib import redirect_stdout, redirect_stderr +from pathlib import Path from src import pygamecfg from src.pygamecfg.__main__ import fct_main +testdir_path = Path(__file__).parent.resolve() + + class Testtest_gen(unittest.TestCase): + def setUp(self) -> None: + chdir(testdir_path.parent.resolve()) + def test_version(self): self.assertNotEqual(pygamecfg.__version__, "?.?.?") diff --git a/test/test_ut99.py b/test/test_ut99.py index b77443e..39ee258 100644 --- a/test/test_ut99.py +++ b/test/test_ut99.py @@ -7,18 +7,16 @@ # work. If not, see . import unittest -from os import linesep, path, chdir +from os import path, chdir from io import StringIO from contextlib import redirect_stdout, redirect_stderr from pathlib import Path -import glob import shutil from src import pygamecfg from src.pygamecfg.__main__ import fct_main testdir_path = Path(__file__).parent.resolve() -chdir(testdir_path.parent.resolve()) class Testtest_ut99(unittest.TestCase): @@ -26,6 +24,7 @@ class Testtest_ut99(unittest.TestCase): self.CleanTmp() def setUp(self) -> None: + chdir(testdir_path.parent.resolve()) self.CleanTmp() shutil.copytree(testdir_path / "data", testdir_path / "tmp") print("======================")