forked from mcbarlowe/nba_scraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_functional.py
36 lines (28 loc) · 866 Bytes
/
test_functional.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
35
36
"""
Functional tests for nba_scraper module
"""
import pandas as pd
import nba_scraper.nba_scraper as ns
def test_scrape_return():
"""
this test the scrape_game function for regular season game
"""
dataframe = ns.scrape_game([21000010])
assert isinstance(dataframe, pd.DataFrame)
def test_scrape_playoffs_return():
"""
this tests the scrape_game function for playoff game
"""
dataframe = ns.scrape_game([41700151])
assert isinstance(dataframe, pd.DataFrame)
def test_scrape_date_range():
"""
this tests the scrape_date_range function to make sure it works
"""
dataframe = ns.scrape_date_range("2017-10-18", "2017-10-18")
assert isinstance(dataframe, pd.DataFrame)
def test_scrape_file():
"""
this test the dataframe to csv function
"""
ns.scrape_game([20200992], data_format="csv")