Files
my-botty/test/utils/misc_test.py
T
mgleed 27ebd1b4db Refactor: TemplateFinder() (#770)
* init, wip

* time to test

* remove unused dataclass

* tests passing, just need to run in-game

* fix wait logic

* add threading lock, delete excess funcs

* start putting best_match back in to search_and_wait()

* bugfixes, found a bad template

* scope

* fix npc detect
2022-05-18 01:35:27 -04:00

19 lines
557 B
Python

import pytest
from logger import Logger
from utils.misc import load_template
class TestUtilsMisc:
def setup_method(self):
Logger.init()
Logger.remove_file_logger()
@pytest.mark.parametrize("path, should_be_success", [
("test/assets/hero_select.png", True),
("some/random/path/that/not/a/file.png", False),
])
def test_load_template(self, path: str, should_be_success: bool):
template_img = load_template(path)
success = template_img is not None
assert(success == should_be_success)