# Path: bot/providers/trainer_matches.py
# class Trainer(object):
# class BoundingTrainer(Trainer):
#     def __init__(self, query, x=0, y=0):
#     def get_matches(self, train, corr):
#     def compare_distances(self, train_img, cluster, good_matches):
#     def debug_matcher(self, img):
#     def read_captured_circles(self):
#     def capture_white_circles(self, x_limit=480, y_limit=670):
#     def draw_circles(self, circles, cimg):
#     def prep_for_white_circles(self):
#     def compare(self):
#     def show_area(x, y, image):
#     def __init__(self, query, x=0, y=0, w=0, h=0, bounding_area=None, blacklist=None):
#     def in_box(self, x, y):
#     def in_blacklist(self, x, y):
#     def get_matches(self, train, corr):
#     def capture_white_circles(self):
#     def show_area(x, y, w, h, image):
#     def show_area_bounded(bounding_area, image):
# 
# Path: bot/shared.py
# LOW_CORR = 2


from unittest import TestCase
from bot.providers import trainer_matches as tm
from bot.shared import LOW_CORR
import os
import cv2




base = '..\\assets'


class TestTrainer(TestCase):
    def test_get_matches(self):
        location = os.path.join(base, "ok_box.png")
        base_location = os.path.join(base, "nox", "vagabond.png")
        black_screen = os.path.join(base, "nox", "black_screen.png")
        assert os.path.exists(location)
        assert os.path.exists(base_location)
        assert os.path.exists(black_screen)
        base_img = cv2.imread(base_location)
        trainer = tm.Trainer(base_img, 480, 50)
        self.assertTrue(trainer.get_matches(location, LOW_CORR) is False)
        base_img = cv2.imread(black_screen)
        trainer = tm.Trainer(base_img, 480, 50)

# Path: bot/providers/trainer_matches.py
# class Trainer(object):
# class BoundingTrainer(Trainer):
#     def __init__(self, query, x=0, y=0):
#     def get_matches(self, train, corr):
#     def compare_distances(self, train_img, cluster, good_matches):
#     def debug_matcher(self, img):
#     def read_captured_circles(self):
#     def capture_white_circles(self, x_limit=480, y_limit=670):
#     def draw_circles(self, circles, cimg):
#     def prep_for_white_circles(self):
#     def compare(self):
#     def show_area(x, y, image):
#     def __init__(self, query, x=0, y=0, w=0, h=0, bounding_area=None, blacklist=None):
#     def in_box(self, x, y):
#     def in_blacklist(self, x, y):
#     def get_matches(self, train, corr):
#     def capture_white_circles(self):
#     def show_area(x, y, w, h, image):
#     def show_area_bounded(bounding_area, image):
# 
# Path: bot/shared.py
# LOW_CORR = 2


# Path: tests/test_trainer.py
from unittest import TestCase
from bot.providers import trainer_matches as tm
from bot.shared import LOW_CORR
import os
import cv2





base = '..\\assets'


class TestTrainer(TestCase):
    def test_get_matches(self):
        location = os.path.join(base, "ok_box.png")
        base_location = os.path.join(base, "nox", "vagabond.png")
        black_screen = os.path.join(base, "nox", "black_screen.png")
        assert os.path.exists(location)
        assert os.path.exists(base_location)
        assert os.path.exists(black_screen)
        base_img = cv2.imread(base_location)
        trainer = tm.Trainer(base_img, 480, 50)
        self.assertTrue(trainer.get_matches(location, LOW_CORR) is False)
        base_img = cv2.imread(black_screen)
        trainer = tm.Trainer(base_img, 480, 50)

        self.assertTrue(trainer.get_matches(location, LOW_CORR) is False)