Skip to content

Commit

Permalink
Merge branch 'features/new_data_structure_with_check' of github.com:w…
Browse files Browse the repository at this point in the history
…ind-python/windpowerlib into features/new_data_structure_with_check
  • Loading branch information
uvchik committed May 22, 2020
2 parents 9446ed1 + 483ce55 commit 02662c6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/test_data_handling.py
Expand Up @@ -22,16 +22,18 @@ def setup_class(cls):
cls.time_stamp = datetime.now().strftime("%Y%m%d%H%M%S")
cls.broken_fn = os.path.join(cls.path, "power_curves_broken.csv")
cls.backup_fn = os.path.join(cls.path, "power_curves_backup.csv")
cls.orig_path = os.path.join(os.path.dirname(__file__), os.pardir,
"windpowerlib", "oedb")
cls.orig_path = os.path.join(
os.path.dirname(__file__), os.pardir, "windpowerlib", "oedb"
)
cls.orig_fn = os.path.join(cls.orig_path, "power_curves.csv")

@classmethod
def teardown_class(cls):
cls.path = os.path.join(os.path.dirname(__file__), "oedb")
cls.backup_fn = os.path.join(cls.path, "power_curves_backup.csv")
orig_path = os.path.join(os.path.dirname(__file__), os.pardir,
"windpowerlib", "oedb")
orig_path = os.path.join(
os.path.dirname(__file__), os.pardir, "windpowerlib", "oedb"
)
cls.orig_fn = os.path.join(orig_path, "power_curves.csv")
copyfile(cls.backup_fn, cls.orig_fn)
for f in os.listdir(cls.path):
Expand All @@ -46,8 +48,9 @@ def test_normal_data_check(self):
for curve_type in ["power_curve", "power_coefficient_curve"]:
copyfile(
self.filename.format("{}s".format(curve_type)),
self.filename.format("{0}s_{1}".format(curve_type,
self.time_stamp)),
self.filename.format(
"{0}s_{1}".format(curve_type, self.time_stamp)
),
)
check_imported_data(self.df, self.filename, self.time_stamp)

Expand All @@ -71,4 +74,3 @@ def test_broken_pwr_curve(self):
msg = "could not convert string to float"
with pytest.raises(ValueError, match=msg):
check_imported_data(self.df, self.filename, self.time_stamp)

0 comments on commit 02662c6

Please sign in to comment.