def test_start(self): with pytest.raises(TypeError): DataLoader(directory=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)
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)
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)
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)
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)
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)
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)