Skip to content

Commit

Permalink
pasted out tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Eggimann committed Dec 12, 2018
1 parent ad242e2 commit d74f21e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions tests/assumptions/test_base_assumptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pkg_resources import resource_filename
from pkg_resources import Requirement

def test_load_non_param_assump():
'''def test_load_non_param_assump():
"""
"""
path_main = resource_filename(
Expand Down Expand Up @@ -38,7 +38,7 @@ def test_load_param_assump():
"""
"""
path_main = resource_filename(
Requirement.parse("energy_demand"), os.path.join("energy_demand", "config_data"))
Requirement.parse("energy_demand"), os.path.join("..", "data", "energy_demand", "config_data"))
# Load data
data = {}
Expand All @@ -52,3 +52,4 @@ def test_load_param_assump():
# Dummy test
assert sim_param_expected['base_yr'] == 2015
return
test_load_param_assump()'''
10 changes: 5 additions & 5 deletions tests/test_enduse_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,16 @@ def test_calc_lf_improvement():

#all factors must be smaller than one
loadfactor_yd_cy = np.zeros((2, 2)) #to fueltypes, two days
loadfactor_yd_cy[0][0] = 0.2
loadfactor_yd_cy[0][1] = 0.4
loadfactor_yd_cy[1][0] = 0.1
loadfactor_yd_cy[1][1] = 0.3
loadfactor_yd_cy[0][0] = 2
loadfactor_yd_cy[0][1] = 4
loadfactor_yd_cy[1][0] = 1
loadfactor_yd_cy[1][1] = 3

result = enduse_func.calc_lf_improvement(
param_lf_improved_cy=param_lf_improved_cy,
loadfactor_yd_cy=loadfactor_yd_cy)

expected = loadfactor_yd_cy + 0.25
expected = loadfactor_yd_cy + 25

assert result[0][0] == expected[0][0]
assert result[0][1] == expected[0][1]
Expand Down

0 comments on commit d74f21e

Please sign in to comment.