Skip to content

Commit

Permalink
fix(single-mode): wrong race years
Browse files Browse the repository at this point in the history
  • Loading branch information
NateScarlet committed Jun 6, 2021
1 parent 03bbd86 commit 21ebf41
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions auto_derby/single_mode/race.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Race:

PERMISSION_JUNIOR = 1
PERMISSION_CLASSIC = 2
PERMISSION_JUNIOR_OR_CLASSIC = 3
PERMISSION_SENIOR_OR_CLASSIC = 3
PERMISSION_SENIOR = 4
PERMISSION_URA = 5

Expand Down Expand Up @@ -117,8 +117,8 @@ def years(self) -> Tuple[int, ...]:
return (1,)
if self.permission == self.PERMISSION_CLASSIC:
return (2,)
if self.permission == self.PERMISSION_JUNIOR_OR_CLASSIC:
return (1, 2)
if self.permission == self.PERMISSION_SENIOR_OR_CLASSIC:
return (2, 3)
if self.permission == self.PERMISSION_SENIOR:
return (3,)
if self.permission == self.PERMISSION_URA:
Expand Down
10 changes: 10 additions & 0 deletions auto_derby/single_mode/race_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,13 @@ def test_find_by_race_detail_image_5():
race1 = race.find_by_race_detail_image(ctx, img)

assert race1.name == "菊花賞", race1.name


def test_find_by_race_detail_image_6():

img = PIL.Image.open(_test.DATA_PATH / "race_detail_6.png").convert("RGB")
ctx = Context()
ctx.date = (3, 6, 2)
race1 = race.find_by_race_detail_image(ctx, img)

assert race1.name == "宝塚記念", race1.name
Loading
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 21ebf41

Please sign in to comment.