<s> from genmod . score_variants import ConfigParser <EOL> CONFIG = "<STR_LIT>" <EOL> def test_config_parser ( ) : <EOL> """<STR_LIT>""" <EOL> config_reader = ConfigParser ( CONFIG ) <EOL> assert set ( config_reader . plugins ) == set ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> assert set ( config_reader . categories . keys ( ) ) == set ( [ '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> assert set ( config_reader . categories [ '<STR_LIT>' ] . keys ( ) ) == set ( [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> assert set ( config_reader . categories [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) == set ( [ '<STR_LIT>' ] ) <EOL> def test_get_score ( ) : <EOL> """<STR_LIT>""" <EOL> config_reader = ConfigParser ( CONFIG ) <EOL> variant = { '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } } <EOL> assert config_reader . plugins [ '<STR_LIT>' ] . get_value ( variant_dict = variant ) == <NUM_LIT:0.1> <EOL> assert config_reader . plugins [ '<STR_LIT>' ] . get_value ( variant_dict = variant ) == <NUM_LIT:12> <EOL> assert config_reader . score_functions [ '<STR_LIT>' ] . get_score ( <NUM_LIT> ) == <NUM_LIT:1.0> <EOL> assert config_reader . score_functions [ '<STR_LIT>' ] . get_score ( <NUM_LIT> ) == <NUM_LIT> <EOL> assert config_reader . score_functions [ '<STR_LIT>' ] . get_score ( None ) == <NUM_LIT> <EOL> def test_get_score_string ( ) : <EOL> """<STR_LIT>""" <EOL> config_reader = ConfigParser ( CONFIG ) <EOL> variant = { '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } } <EOL> assert config_reader . plugins [ '<STR_LIT>' ] . get_value ( variant_dict = variant ) == "<STR_LIT>" <EOL> assert config_reader . score_functions [ '<STR_LIT>' ] . get_score ( "<STR_LIT>" ) == <NUM_LIT> <EOL> assert config_reader . score_functions [ '<STR_LIT>' ] . get_score ( "<STR_LIT>" ) == <NUM_LIT> <EOL> assert config_reader . score_functions [ '<STR_LIT>' ] . get_score ( None ) == - <NUM_LIT:12> <EOL> def test_get_score_value ( ) : <EOL> """<STR_LIT>""" <EOL> config_reader = ConfigParser ( CONFIG ) <EOL> variant = { '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:2>' , <EOL> } } <EOL> assert config_reader . plugins [ '<STR_LIT>' ] . get_value ( variant_dict = variant ) == <NUM_LIT:2> <EOL> assert config_reader . score_functions [ '<STR_LIT>' ] . get_score ( <NUM_LIT:2> ) == - <NUM_LIT:1.0> <EOL> def test_get_score_value_multiple_values ( ) : <EOL> """<STR_LIT>""" <EOL> config_reader = ConfigParser ( CONFIG ) <EOL> variant = { '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } } <EOL> assert config_reader . plugins [ '<STR_LIT>' ] . get_raw_entry ( variant_dict = variant ) == '<STR_LIT>' <EOL> assert config_reader . plugins [ '<STR_LIT>' ] . get_entry ( variant_dict = variant ) == [ '<STR_LIT:2>' , '<STR_LIT:5>' ] <EOL> assert config_reader . plugins [ '<STR_LIT>' ] . get_value ( variant_dict = variant ) == <NUM_LIT:5> <EOL> assert config_reader . score_functions [ '<STR_LIT>' ] . get_score ( <NUM_LIT:5> ) == <NUM_LIT:2> </s>
