-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.py
32 lines (27 loc) · 1.05 KB
/
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
import ycnbc
import unittest
categories = [
'world-economy', 'us-economy', 'federal-reserve', 'central-banks', 'jobs', 'banks', 'investing',
'hedge-funds', 'deals-and-ipos', 'insurance',
'venture-capital', 'coronavirus', 'wall-street',
'economy', 'health-and-science', 'media',
'climate', 'wealth', 'life',
'small-business', 'energy', 'finance',
'transportation', 'industrials', 'real-estate',
'retail', 'cybersecurity', 'enterprise',
'internet', 'media', 'mobile',
'white-house', 'china-politics', 'social-media',
'policy', 'defense', 'congress',
'hospitals', 'life-and-health-insurance'
]
class TestGetData(unittest.TestCase):
def test_getTrendingnews(self):
assert(ycnbc.get_trendingnews().empty is False)
def test_getLatestnews(self):
assert(ycnbc.get_latestnews().empty is False)
def test_getDatanews(self):
for i in categories:
print(ycnbc.get_datanews(i))
assert(ycnbc.get_datanews(i).empty is False)
if __name__ == '__main__':
unittest.main()