def shouldRaiseTypeErrorIfIndexIsNotAnIngeger(self): obj = CellHandlers() obj.addHandlers(["Blank", "Asis"]) assert obj[0] == CellHandler("Blank") assert obj[1] == CellHandler("Asis") self.assertRaises(TypeError, obj.__getitem__, "0")
def shouldNotAddAnInvalidHandler(self): obj = CellHandlers() obj.addHandlers(["Blank", "Foo", "Asis"]) assert len(obj) == 2
def shouldReturnItemByIndex(self): obj = CellHandlers() obj.addHandlers(["Blank", "Asis"]) assert obj[0] == CellHandler("Blank") assert obj[1] == CellHandler("Asis") self.assertRaises(IndexError, obj.__getitem__, 2)
def shouldAddListOfHandlersToList(self): obj = CellHandlers() obj.addHandlers(["Blank", "Asis"]) assert len(obj) == 2
def shouldRemoveHandlersInListFromList(self): obj = CellHandlers() obj.addHandlers(["Blank", "Asis", "Null"]) assert len(obj) == 3 obj.removeHandlers(["Null", "Asis"]) assert len(obj) == 1