Merge pull request 'chore: make all unittest same' (#4) from dev into master
Reviewed-on: https://chacha.ddns.net/gitea/chacha/pygamecfg/pulls/4 new-tag:0.3.1
This commit was merged in pull request #4.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -7,18 +7,16 @@
|
||||
# work. If not, see <https://creativecommons.org/licenses/by-nc-sa/4.0/>.
|
||||
|
||||
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:
|
||||
|
||||
@@ -7,14 +7,22 @@
|
||||
# work. If not, see <https://creativecommons.org/licenses/by-nc-sa/4.0/>.
|
||||
|
||||
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__, "?.?.?")
|
||||
|
||||
|
||||
@@ -7,18 +7,16 @@
|
||||
# work. If not, see <https://creativecommons.org/licenses/by-nc-sa/4.0/>.
|
||||
|
||||
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("======================")
|
||||
|
||||
Reference in New Issue
Block a user