def test_no_value_as_list(metplus_config): """! Tests that a key with no list of strings returns an empty list.""" conf_obj = get_config_obj(metplus_config) expected_unassigned = [] unassigned = util.getlist(conf_obj.getstr('config', 'UNASSIGNED_VALUE')) assert unassigned == expected_unassigned
def test_getlist_begin_end_incr(list_string, output_list): assert (util.getlist(list_string) == output_list)
def test_getlist_has_commas(): l = 'gt2.7, >3.6, eq42, "has,commas,in,it"' test_list = util.getlist(l) assert (test_list == ['gt2.7', '>3.6', 'eq42', 'has,commas,in,it'])
def test_getlist_empty(): l = '' test_list = util.getlist(l) assert (test_list == [])
def test_getlist(): l = 'gt2.7, >3.6, eq42' test_list = util.getlist(l) assert (test_list == ['gt2.7', '>3.6', 'eq42'])