def test_cnf_is_bool_stristate(self): model = CnfModel(self.cnf_file.name) for symbol in ('CONFIG_FOO', 'CONFIG_BAR', 'FOO', 'BAR'): st = model.get_type(symbol) self.assertTrue(model.is_bool_tristate(symbol), "symbol %s has type %s " % (symbol, st)) self.assertFalse(model.is_bool_tristate('HURZ'))
def test_cnf_symbols(self): model = CnfModel(self.cnf_file.name) for symbol in ('CONFIG_FOO', 'CONFIG_BAR'): self.assertIn(symbol, model) for symbol in ('FOO', 'BAR', 'CONFIG_BAR_MODULE'): self.assertNotIn(symbol, model)
def test_cnf_metaflgas(self): model = CnfModel(self.cnf_file.name) self.assertNotIn('CONFIG_FOO', model.always_off_items) self.assertNotIn('CONFIG_BAR', model.always_on_items) self.assertIn('CONFIG_BAR', model.always_off_items) self.assertIn('CONFIG_FOO', model.always_on_items)
def test_cnf_types(self): model = CnfModel(self.cnf_file.name) self.assertEqual(model.get_type('CONFIG_BAR'), "boolean") self.assertEqual(model.get_type('CONFIG_FOO'), "tristate")