Skip to content

Commit

Permalink
bug: removed wrong entry and improved unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SlashGordon committed Jun 4, 2021
1 parent 03fbb6a commit 639f498
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
29 changes: 8 additions & 21 deletions stocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2377,23 +2377,6 @@ companies:
employees: 3290
isins:
- DE0005313704
- id: 101
name: Ceconomy St.
symbol: CEC
country: Germany
indices: []
industries:
- Computer & Electronics Retailers
- Retailers
- Specialty Retailers
- Consumer Cyclicals
symbols:
- yahoo: CEC.F
google: FRA:CEC
currency: EUR
metadata:
founded: unknown
employees: unknown
- id: 102
name: CEWE Stiftung & Co. KGaA
symbol: CWC
Expand Down Expand Up @@ -25772,14 +25755,18 @@ companies:
country: Germany
indices:
- SDAX
industries: []
industries:
- Computer & Electronics Retailers
- Retailers
- Specialty Retailers
- Consumer Cyclicals
symbols:
- yahoo: CEC1.F
google: FRA:CEC1
currency: EUR
- yahoo: MTGGY
google: OTCMKTS:MTGGY
currency: USD
- yahoo: CEC.F
google: FRA:CEC
currency: EUR
isins:
- DE0007257503
- DE0007257537
Expand Down
17 changes: 14 additions & 3 deletions tests/test_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,19 @@ def test_encoding(self):
"""
stock_data = PyTickerSymbols()
self.assertIsNotNone(stock_data)
dax = list(stock_data.get_stocks_by_index('DAX'))
self.assertEqual(dax[10]['name'], 'Deutsche Börse AG')
stocks = list(stock_data.get_all_stocks())
names_with_unicode_count = sum(
[
any(
word in item['name']
for word in ['ö', 'ä', 'ü', 'é', 'è', 'ë']
)
for item in stocks
]
)
self.assertTrue(
names_with_unicode_count >= 20, names_with_unicode_count
)

def test_country(self):
"""
Expand Down Expand Up @@ -343,7 +354,7 @@ def test_tickers_by_index(self):
for test_item in test_list:
self.assertEqual(len(test_item), 30)
for tickers in test_item:
self.assertTrue(len(tickers) >= 2)
self.assertTrue(len(tickers) >= 1, tickers)

def test_tickers_valid(self):
"""
Expand Down

0 comments on commit 639f498

Please sign in to comment.