-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
34 lines (24 loc) · 919 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import unittest
# from unittest.mock import patch, mock_open, MagicMock
# import json
# import os
from playerInfo import PlayerInfo
class TestPlayerInfo(unittest.TestCase):
def setUp(cls):
cls.player_tag = '#999002QU'
cls.filename = 'testData.json'
cls.player_info = PlayerInfo(cls.player_tag, cls.filename)
def testGetTag(self):
# Test getTag method with existing data
tag = self.player_info.getTag()
self.assertEqual(tag, "#999002QU")
def testGetName(self):
# Test getName method with existing data
name = self.player_info.getName()
self.assertEqual(name, "PlotoZypresse")
def testWinRate(self):
# Test tag method with existing data
winRate = self.player_info.playerWinRate()
self.assertEqual(winRate, "All Time winrate: 0.46")
if __name__ == '__main__':
unittest.main()