Skip to content

Commit

Permalink
fix: add URLError to fake dataset scenario, load AppliancesEnergy bef…
Browse files Browse the repository at this point in the history
…ore testing
  • Loading branch information
Lopa10ko committed Sep 23, 2024
1 parent 227c684 commit 4e33b95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/unit/tools/test_load_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from urllib.error import URLError

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -40,11 +41,12 @@ def test_load_univariate_data():


def test_load_fake_data():
with pytest.raises(FileNotFoundError):
with pytest.raises((FileNotFoundError, URLError)):
DataLoader('Fake').load_data()


def test__load_from_tsfile_to_dataframe():
DataLoader('AppliancesEnergy', folder=EXAMPLES_DATA_PATH).load_data()
path = os.path.join(EXAMPLES_DATA_PATH, 'AppliancesEnergy/AppliancesEnergy_TEST.ts')
x, y = MOCK_LOADER._load_from_tsfile_to_dataframe(full_file_path_and_name=path,
return_separate_X_and_y=True)
Expand Down

0 comments on commit 4e33b95

Please sign in to comment.