def test_get(self): ln = BDDList.from_tuple((None, None, None, None, None)) self.assertEqual(ln[0], None) with self.assertRaises(IndexError): ln[-1] with self.assertRaises(IndexError): ln[5] with self.assertRaises(IndexError): ln[6] with self.assertRaises(IndexError): ln["a"]
def test_elements(self): # Initialize the model ret = cmd.Cmd_SecureCommandExecute("read_model -i" "tests/pynusmv/models/admin.smv") self.assertEqual(ret, 0, "cannot read the model") ret = cmd.Cmd_SecureCommandExecute("go") self.assertEqual(ret, 0, "cannot build the model") propDb = glob.prop_database() master = propDb.master fsm = propDb.master.bddFsm init = fsm.init ln = BDDList.from_tuple((init, BDD.true(init._manager), init)) self.assertEqual(len(ln), 3) self.assertSequenceEqual((init, BDD.true(init._manager), init), ln.to_tuple()) del ln
def test_slice(self): ln = BDDList.from_tuple((None, None, None, None, None)) self.assertEqual(len(ln), 5) with self.assertRaises(NotImplementedError): s = ln[2::]
def test_bddlist(self): ln = BDDList.from_tuple((None, None, None)) self.assertEqual(len(ln), 3) for n in ln: self.assertIsNone(n)