Skip to content

Commit

Permalink
fix: stop parsing PlayReqs
Browse files Browse the repository at this point in the history
  • Loading branch information
beheh committed Apr 12, 2024
1 parent ba51ab5 commit 179a7f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions hslog/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from aniso8601 import parse_time
from hearthstone.enums import (
BlockType, ChoiceType, FormatType, GameTag, GameType,
MetaDataType, Mulligan, OptionType, PlayReq, PowerType
MetaDataType, Mulligan, OptionType, PowerType
)

from . import packets, tokens
Expand Down Expand Up @@ -177,8 +177,6 @@ def clean_option_errors(error, error_param):

if error == "NONE":
error = None
else:
error = parse_enum(PlayReq, error)

if not error_param:
error_param = None
Expand Down
6 changes: 3 additions & 3 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from aniso8601 import parse_datetime, parse_time
from hearthstone.enums import (
CardType, ChoiceType, GameTag, OptionType,
PlayReq, PlayState, PowerType, State, Step, Zone
PlayState, PowerType, State, Step, Zone
)

from hslog import LogParser, packets
Expand Down Expand Up @@ -303,7 +303,7 @@ def test_options_packet_with_errors(self):
assert op0.id == 0
assert op0.type == OptionType.END_TURN
assert op0.entity is None
assert op0.error == PlayReq.INVALID
assert op0.error == "INVALID"
assert op0.error_param is None

op1 = options_packet.options[1]
Expand All @@ -317,7 +317,7 @@ def test_options_packet_with_errors(self):
target = op1.options[11]
assert target.id == 11
assert target.entity == 37
assert target.error == PlayReq.REQ_TARGET_MAX_ATTACK
assert target.error == "REQ_TARGET_MAX_ATTACK"
assert target.error_param == 3

def test_options_no_option_packet(self):
Expand Down

0 comments on commit 179a7f5

Please sign in to comment.