Files
my-botty/test/target_detect_test.py
T
mgleed 99778ea51f Refactor: Use class objects for mobs for mob checking (#767)
* init, wip

* refactor mob_check, wip

* update hammerdin

* fix hammerdin
2022-05-13 16:18:13 -04:00

16 lines
435 B
Python

import cv2
import pytest
import screen
from target_detect import get_visible_targets
import screen
@pytest.mark.parametrize("screen_path, expected_res", [
("test/assets/mobs.png", True),
("test/assets/mobs_no_green_or_blue.png", False),
])
def test_target_detect(screen_path, expected_res):
screen.set_window_position(0, 0)
img = cv2.imread(screen_path)
assert bool(len(get_visible_targets(img))) == expected_res