Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Santonia27 committed Oct 31, 2023
1 parent 93e11c1 commit 836c744
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_create_step_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

def test_create_step_function():
x = Vulnerability()
name = "roads_2"
name = "roads"
min_hazard_input = 0
max_hazard_input = 15
threshold_value = 0.5
step_hazard_value = 2
x.create_step_function("roads")
x.create_step_function("roads_2")
x.create_step_function(name, threshold_value, min_hazard_input, max_hazard_input, step_hazard_value)



assert x.functions == {'roads': [0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], 'roads_2': [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]}
assert x.hazard_values == [0.0, 0.49, 0.5, 0.59, 0.6, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
assert x.functions == {'roads_2': [0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], 'roads': [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]}
assert x.hazard_values == [0.0, 0.49, 0.5, 0.59, 0.6, 1, 2.0, 3, 4.0, 5, 6.0, 7, 8.0, 9, 10.0, 11, 13, 15]

0 comments on commit 836c744

Please sign in to comment.