Skip to content

Commit

Permalink
fix(team-race): update template for adb device
Browse files Browse the repository at this point in the history
fix #144
  • Loading branch information
NateScarlet committed Aug 16, 2021
1 parent 4ff2808 commit 2f265db
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
Binary file modified auto_derby/templates/team_race_choose_competitor.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified auto_derby/templates/team_race_choose_competitor.pos.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions auto_derby/templates/team_race_choose_competitor_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from auto_derby import mathtools
from . import _test
from .. import template, templates


_EXPECTED_POS = (240, 154)


def test_match():
img, rp = _test.use_screenshot("team_race_arena.png")
res = tuple(template.match(img, templates.TEAM_RACE_CHOOSE_COMPETITOR))
assert len(res) == 1
(match1,) = res
assert match1[1] == rp.vector2(_EXPECTED_POS, 540)


def test_match_issue135():
img, rp = _test.use_screenshot("team_race_arena_issue144.png")
res = tuple(template.match(img, templates.TEAM_RACE_CHOOSE_COMPETITOR))
assert len(res) == 1
(match1,) = res
assert mathtools.distance(match1[1], rp.vector2(_EXPECTED_POS, 540)) < 8
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2f265db

Please sign in to comment.