Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
spookybear0 committed Dec 21, 2024
1 parent 71abe55 commit ca72cb5
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions helpers/tdfhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,6 @@ async def parse_sm5_game(file_location: str) -> SM5Game:
logger.debug(
f"Team Info: index: {data[1]}, name: {data[2]}, color enum: {data[3]}, color name: {data[4]}")
case "3": # entity start
sentry_sdk.set_context(
"entity_start", {
"time": data[1],
"entity_id": data[2],
"type": data[3],
"name": data[4],
"team": data[5],
"level": data[6],
"role": data[7],
"battlesuit": data[8],
"member_id": data[9]
}
)

team = None

for t in teams:
Expand All @@ -142,6 +128,20 @@ async def parse_sm5_game(file_location: str) -> SM5Game:
except (ValueError, IndexError):
member_id = None

sentry_sdk.set_context(
"entity_start", {
"time": data[1],
"entity_id": data[2],
"type": data[3],
"name": data[4],
"team": data[5],
"level": data[6],
"role": data[7],
"battlesuit": data[8],
"member_id": member_id
}
)

name = data[4].strip() # remove whitespace (some names have trailing whitespace for some reason)

entity_start = await EntityStarts.create(time=int(data[1]), entity_id=data[2], type=data[3], name=name,
Expand Down Expand Up @@ -491,20 +491,6 @@ async def parse_laserball_game(file_location: str) -> LaserballGame:
logger.debug(
f"Team Info: index: {data[1]}, name: {data[2]}, color enum: {data[3]}, color name: {data[4]}")
case "3": # entity start
sentry_sdk.set_context(
"entity_start", {
"time": data[1],
"entity_id": data[2],
"type": data[3],
"name": data[4],
"team": data[5],
"level": data[6],
"role": data[7],
"battlesuit": data[8],
"member_id": data[9]
}
)

team = None

for t in teams:
Expand All @@ -522,6 +508,20 @@ async def parse_laserball_game(file_location: str) -> LaserballGame:
member_id = None

name = data[4].strip() # remove whitespace (some names have trailing whitespace for some reason)

sentry_sdk.set_context(
"entity_start", {
"time": data[1],
"entity_id": data[2],
"type": data[3],
"name": data[4],
"team": data[5],
"level": data[6],
"role": data[7],
"battlesuit": data[8],
"member_id": member_id
}
)

entity_start = await EntityStarts.create(time=int(data[1]), entity_id=data[2], type=data[3], name=name,
team=team, level=int(data[6]), role=int(data[7]),
Expand Down

0 comments on commit ca72cb5

Please sign in to comment.