Skip to content

Commit

Permalink
add test database
Browse files Browse the repository at this point in the history
  • Loading branch information
oczkers committed Apr 29, 2017
1 parent 7713e7e commit bf4fb5f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test_fut.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@ def testBaseId(self):
self.assertEqual(fut.core.baseId(50556989), 225341)
self.assertEqual(fut.core.baseId(67340541), 231677)

def testDatabase(self):
self.db_nations = fut.core.nations()
self.db_leagues = fut.core.leagues()
self.db_teams = fut.core.teams()
self.db_players = fut.core.players()

self.assertEqual(self.db_nations[1], 'Albania')
self.assertEqual(self.db_nations[133], 'Nigeria')
self.assertEqual(self.db_nations[190], 'United Arab Emirates')
self.assertEqual(self.db_leagues[68], 'Süper Lig')
self.assertEqual(self.db_leagues[80], 'Österreichische Fußball-Bundesliga')
self.assertEqual(self.db_leagues[66], 'T-Mobile Ekstraklasa')
self.assertEqual(self.db_teams[1], 'Arsenal')
self.assertEqual(self.db_teams[1458], 'SAİ Kayseri Erciyesspor')
self.assertEqual(self.db_teams[111827], 'Club Deportivo Guadalajara')
self.assertEqual(self.db_players[227223], {'lastname': 'Vita', 'surname': None, 'rating': 65, 'nationality': 27, 'id': 227223, 'firstname': 'Alessio'})
self.assertEqual(self.db_players[159017], {'lastname': 'Hämäläinen', 'surname': None, 'rating': 72, 'nationality': 17, 'id': 159017, 'firstname': 'Kasper'})
self.assertEqual(self.db_players[1179], {'lastname': 'Buffon', 'surname': None, 'rating': 88, 'nationality': 27, 'id': 1179, 'firstname': 'Gianluigi'})

def testInvalidAccount(self):
self.assertRaises(FutError, fut.Core, 'test', 'test', 'test')

Expand Down

0 comments on commit bf4fb5f

Please sign in to comment.