This will raise a key error 'test_alm' isn't in self.config. I think what you want is.

    if 'test_alm' in self.config and self.config['test_alm'] not in ['server', 'project', 'settings']: