示例#1
0
 def test_start(self):
     with pytest.raises(TypeError):
         DataLoader(directory=0)
示例#2
0
 def test_oxcgrt_local_file(self):
     data_loader = DataLoader("input")
     local_path = Path("input") / "OxCGRT_latest.csv"
     data_loader.oxcgrt(local_file=local_path)
     local_file = str(local_path)
     data_loader.oxcgrt(local_file=local_file)
示例#3
0
 def test_oxcgrt_local_file_unexpected(self):
     data_loader = DataLoader("input")
     local_path = Path("input") / "covid_jpn_total.csv"
     with pytest.raises(Exception):
         data_loader.oxcgrt(local_file=local_path)
示例#4
0
 def test_subset(self):
     data_loader = DataLoader("input")
     jhu_data = data_loader.jhu()
     df = jhu_data.subset("Japan")
     assert isinstance(df, pd.DataFrame)
     assert set(df.columns) == set(Word.NLOC_COLUMNS)
示例#5
0
 def test_japan_cases_local_file_unexpected(self):
     data_loader = DataLoader("input")
     local_path = Path("input") / "covid_19_data.csv"
     with pytest.raises(Exception):
         data_loader.japan(local_file=local_path)
示例#6
0
 def test_japan_cases_local_file(self):
     data_loader = DataLoader("input")
     local_path = Path("input") / "covid_jpn_total.csv"
     data_loader.japan(local_file=local_path)
     local_file = str(local_path)
     data_loader.japan(local_file=local_file)
示例#7
0
 def test_jhu_local_file_unexpected(self):
     data_loader = DataLoader("input")
     local_path = Path("input") / "covid_jpn_total.csv"
     with pytest.raises(KeyError):
         data_loader.jhu(local_file=local_path)
示例#8
0
 def test_jhu_local_file(self):
     data_loader = DataLoader("input")
     local_path = Path("input") / "covid_19_data.csv"
     data_loader.jhu(local_file=local_path)
     local_file = str(local_path)
     data_loader.jhu(local_file=local_file)