I try to find if a variable has a valid value which is stored in a list. The name of the list is also stored in a variable. If the variable is not valid the test should fail