File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from itertools import chain , permutations
12from pathlib import Path
23
34import toml
@@ -459,3 +460,34 @@ def test_check_utilization_not_all_zero_fail_missing_column():
459460
460461 with raises (ValueError ):
461462 check_utilization_not_all_zero (df , "file.csv" )
463+
464+
465+ def test_check_minimum_service_factors_in_range_success ():
466+ import pandas as pd
467+ from muse .readers .csv import check_minimum_service_factors_in_range
468+
469+ df = pd .DataFrame ({"minimum_service_factor" : (0 , 1 )})
470+ check_minimum_service_factors_in_range (df , "file.csv" )
471+
472+
473+ def test_check_minimum_service_factors_in_range_column_missing ():
474+ import pandas as pd
475+ from muse .readers .csv import check_minimum_service_factors_in_range
476+
477+ # If the minimum_service_factor column is missing, the function should just return
478+ # without raising an error
479+ df = pd .DataFrame ()
480+ check_minimum_service_factors_in_range (df , "file.csv" )
481+
482+
483+ @mark .parametrize (
484+ "values" , chain .from_iterable (permutations ((0 , bad )) for bad in (- 1 , 2 ))
485+ )
486+ def test_check_minimum_service_factors_in_range_fail (values ):
487+ import pandas as pd
488+ from muse .readers .csv import check_minimum_service_factors_in_range
489+
490+ df = pd .DataFrame ({"minimum_service_factor" : values })
491+
492+ with raises (ValueError ):
493+ check_minimum_service_factors_in_range (df , "file.csv" )
You can’t perform that action at this time.
0 commit comments