Skip to content

Commit

Permalink
fix path
Browse files Browse the repository at this point in the history
  • Loading branch information
LaihoE committed Jun 28, 2024
1 parent 40d5b0e commit 95b1ccf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ jobs:
pip install pytest maturin patchelf
maturin develop
pytest
python3 tests/signature_tests.py
25 changes: 13 additions & 12 deletions src/python/tests/signature_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,59 @@
import pandas as pd
from demoparser2 import DemoParser

demo_path = "../parser/test_demo.dem"

class SignatureTest(TestCase):
def test_parse_header_signature(self):
parser = DemoParser("tests/data/test.dem")
parser = DemoParser(demo_path)
header = parser.parse_header()
self.assertIsInstance(header, dict)
for key, value in header.items():
self.assertIsInstance(key, str)
self.assertIsInstance(value, str)

def test_parse_convars_signature(self):
parser = DemoParser("tests/data/test.dem")
parser = DemoParser(demo_path)
convars = parser.parse_convars()
self.assertIsInstance(convars, dict)
for key, value in convars.items():
self.assertIsInstance(key, str)
self.assertIsInstance(value, str)

def test_list_game_events_signature(self):
parser = DemoParser("tests/data/test.dem")
parser = DemoParser(demo_path)
game_events = parser.list_game_events()
self.assertIsInstance(game_events, list)
for event in game_events:
self.assertIsInstance(event, str)

def test_parse_grenades_signature(self):
parser = DemoParser("tests/data/test.dem")
parser = DemoParser(demo_path)
grenades = parser.parse_grenades()
self.assertIsInstance(grenades, pd.DataFrame)

def test_parse_chat_messages_signature(self):
parser = DemoParser("tests/data/test.dem")
parser = DemoParser(demo_path)
chat_messages = parser.parse_chat_messages()
self.assertIsInstance(chat_messages, pd.DataFrame)

def test_parse_player_info_signature(self):
parser = DemoParser("tests/data/test.dem")
parser = DemoParser(demo_path)
player_info = parser.parse_player_info()
self.assertIsInstance(player_info, pd.DataFrame)

def test_parse_item_drops_signature(self):
parser = DemoParser("tests/data/test.dem")
parser = DemoParser(demo_path)
item_drops = parser.parse_item_drops()
self.assertIsInstance(item_drops, pd.DataFrame)

def test_parse_skins_signature(self):
parser = DemoParser("tests/data/test.dem")
parser = DemoParser(demo_path)
skins = parser.parse_skins()
self.assertIsInstance(skins, pd.DataFrame)

def test_parse_event_signature(self):
parser = DemoParser("tests/data/test.dem")
parser = DemoParser(demo_path)

event = parser.parse_event("player_death")
self.assertIsInstance(event, pd.DataFrame)
Expand Down Expand Up @@ -86,7 +87,7 @@ def test_parse_event_signature(self):
parser.parse_event(5)

def test_parse_events_signature(self):
parser = DemoParser("tests/data/test.dem")
parser = DemoParser(demo_path)

events = parser.parse_events(["player_death"])
self.assertIsInstance(events, list)
Expand Down Expand Up @@ -124,15 +125,15 @@ def test_parse_events_signature(self):
parser.parse_events(5)

def test_parse_voice_signature(self):
parser = DemoParser("tests/data/test.dem")
parser = DemoParser(demo_path)
voice = parser.parse_voice()
self.assertIsInstance(voice, dict)
for key, value in voice.items():
self.assertIsInstance(key, str)
self.assertIsInstance(value, bytes)

def test_parse_ticks_signature(self):
parser = DemoParser("tests/data/test.dem")
parser = DemoParser(demo_path)

ticks = parser.parse_ticks(["X", "Y"])
self.assertIsInstance(ticks, pd.DataFrame)
Expand Down

0 comments on commit 95b1ccf

Please sign in to comment.