def test_add_already_added(self):
        prio_set_list = event._PrioritizedSetList()
        obj = object()
        prio_set_list.add(0, obj)

        with pytest.raises(ValueError) as excinfo:
            prio_set_list.add(0, obj)
        excinfo.match(r"has already been added")

        with pytest.raises(ValueError) as excinfo:
            prio_set_list.add(1, obj)
        excinfo.match(r"has already been added")
def __init__(self, host, loginUser, debug = False, trace = False, log=None, port=22, pexpectObject=None):
        self.pexpect = pexpect if not pexpectObject else pexpectObject
        self.debug = debug
        self.trace = trace
        self.host = host
        self._port = port
        self._connection = None
        self.modeList = []
        self._log = log
        self._bufferedCommands = None
        self._bufferedMode = None
        self._loginUser = loginUser
        self._resetExpect()