Skip to content

Commit

Permalink
fix CI bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kaixinol committed Oct 16, 2024
1 parent ff13d3a commit 914a327
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions gameyamlspiderandgenerator/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
if args.silent:
logger.remove()
logger.debug(sys.version)
logger.debug(" ".join(sys.argv))
logger.debug("version: " + version("gameyamlspiderandgenerator"))
if isinstance(args.config, str):
with open(args.config) as f:
Expand Down
8 changes: 8 additions & 0 deletions tests/hook_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,27 @@
from gameyamlspiderandgenerator.util.plugin_manager import pkg

from gameyamlspiderandgenerator.util.config import config
from importlib.metadata import version
from loguru import logger
import sys

config.load(Path(__file__).parent / "test_config.yaml")
pkg.init()

logger.remove()
logger.add(sys.stdout, level="DEBUG")


class HookUnitTest(unittest.TestCase):
def test_all(self):
test_config = {
"search": {"name": "dead-space"},
"validate": {},
}
print(config.hook)
for i in config.hook:
print(template_dict | test_config[i])
print(f"version: {version(f"yamlgenerator_hook_{i}")}")
self.assertIsInstance(
pkg.hook[f"yamlgenerator_hook_{i}"]().setup(
template_dict | test_config[i]
Expand Down
5 changes: 5 additions & 0 deletions tests/local_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
from gameyamlspiderandgenerator.util.config import config
from gameyamlspiderandgenerator.util.fgi_yaml import get_valid_filename
from gameyamlspiderandgenerator.util.plugin_manager import pkg
from loguru import logger
import sys

logger.remove()
logger.add(sys.stdout, level="DEBUG")


def get_time(f):
Expand Down
9 changes: 9 additions & 0 deletions tests/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from pathlib import Path

from gameyamlspiderandgenerator.util.config import config
from loguru import logger

logger.remove()
logger.add(sys.stdout, level="DEBUG")
config.load(Path(__file__).parent / "test_config.yaml")
print(config)
print("*" * 10)
Expand All @@ -24,6 +27,9 @@ def test_steam(self):
"-m",
"gameyamlspiderandgenerator",
"https://store.steampowered.com/app/1470120/Atopes/",
"-f",
"tests/test_config.yaml",
"--debug",
]
)
self.assertEqual(result.returncode, 0)
Expand All @@ -35,6 +41,9 @@ def test_itchio(self):
"-m",
"gameyamlspiderandgenerator",
"https://fymm-game.itch.io/ddp",
"-f",
"tests/test_config.yaml",
"--debug",
]
)
self.assertEqual(result.returncode, 0)
Expand Down

0 comments on commit 914a327

Please sign in to comment.