<s> import unittest <EOL> from conda . resolve import MatchSpec <EOL> from conda_build . metadata import select_lines , handle_config_version <EOL> def test_select_lines ( ) : <EOL> lines = """<STR_LIT>""" <EOL> assert select_lines ( lines , { '<STR_LIT:abc>' : True } ) == """<STR_LIT>""" <EOL> assert select_lines ( lines , { '<STR_LIT:abc>' : False } ) == """<STR_LIT>""" <EOL> class HandleConfigVersionTests ( unittest . TestCase ) : <EOL> def test_python ( self ) : <EOL> for spec , ver , res_spec in [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , None , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , None , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , <NUM_LIT> , '<STR_LIT>' ) , <EOL> ] : <EOL> ms = MatchSpec ( spec ) <EOL> self . assertEqual ( handle_config_version ( ms , ver ) , <EOL> MatchSpec ( res_spec ) ) <EOL> self . assertRaises ( RuntimeError , <EOL> handle_config_version , <EOL> MatchSpec ( '<STR_LIT>' ) , None ) <EOL> def test_numpy ( self ) : <EOL> for spec , ver , res_spec in [ <EOL> ( '<STR_LIT>' , None , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , <NUM_LIT> , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , <NUM_LIT> , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , <NUM_LIT> , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , <NUM_LIT> , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , <NUM_LIT> , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , None , '<STR_LIT>' ) , <EOL> ] : <EOL> ms = MatchSpec ( spec ) <EOL> self . assertEqual ( handle_config_version ( ms , ver ) , <EOL> MatchSpec ( res_spec ) ) <EOL> self . assertRaises ( RuntimeError , <EOL> handle_config_version , <EOL> MatchSpec ( '<STR_LIT>' ) , None ) </s>
