Example #1
0
 def shouldRemoveHandlerByNameFromList(self):
     obj = CellHandlers()
     obj.addHandler(CellHandler("Blank"))
     obj.addHandler(CellHandler("Asis"))
     assert len(obj) == 2
     obj.removeHandler("Blank")
     assert len(obj) == 1
Example #2
0
 def shouldRemoveHandlerByNameFromList(self):
     obj = CellHandlers()
     obj.addHandler(CellHandler("Blank"))
     obj.addHandler(CellHandler("Asis"))
     assert len(obj) == 2
     obj.removeHandler("Blank")
     assert len(obj) == 1
Example #3
0
 def shouldAddListOfHandlersToList(self):
     obj = CellHandlers()
     obj.addHandlers(["Blank", "Asis"])
     assert len(obj) == 2
Example #4
0
 def shouldAddHandlerByName(self):
     obj = CellHandlers()
     obj.addHandler("Blank")
     assert len(obj) == 1
Example #5
0
 def shouldntAddDuplicatesToList(self):
     obj = CellHandlers()
     obj.addHandler(CellHandler("Blank"))
     obj.addHandler(CellHandler("Blank"))
     assert len(obj) == 1
Example #6
0
 def shouldAddCellHandlersToList(self):
     obj = CellHandlers()
     obj.addHandler(CellHandler("Blank"))
     obj.addHandler(CellHandler("Asis"))
     assert len(obj) == 2
Example #7
0
 def shouldntAddDuplicatesToList(self):
     obj = CellHandlers()
     obj.addHandler(CellHandler("Blank"))
     obj.addHandler(CellHandler("Blank"))
     assert len(obj) == 1
Example #8
0
 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)
Example #9
0
 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)
Example #10
0
 def shouldNotAddAnInvalidHandler(self):
     obj = CellHandlers()
     obj.addHandlers(["Blank", "Foo", "Asis"])
     assert len(obj) == 2
Example #11
0
 def shouldRemoveHandlersInListFromList(self):
     obj = CellHandlers()
     obj.addHandlers(["Blank", "Asis", "Null"])
     assert len(obj) == 3
     obj.removeHandlers(["Null", "Asis"])
     assert len(obj) == 1
Example #12
0
 def shouldAddListOfHandlersToList(self):
     obj = CellHandlers()
     obj.addHandlers(["Blank", "Asis"])
     assert len(obj) == 2
Example #13
0
 def shouldAddHandlerByName(self):
     obj = CellHandlers()
     obj.addHandler("Blank")
     assert len(obj) == 1
Example #14
0
 def shouldRemoveHandlersInListFromList(self):
     obj = CellHandlers()
     obj.addHandlers(["Blank", "Asis", "Null"])
     assert len(obj) == 3
     obj.removeHandlers(["Null", "Asis"])
     assert len(obj) == 1
Example #15
0
 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")
Example #16
0
 def shouldNotAddAnInvalidHandler(self):
     obj = CellHandlers()
     obj.addHandlers(["Blank", "Foo", "Asis"])
     assert len(obj) == 2
Example #17
0
 def shouldInitializeFromAList(self):
     obj = CellHandlers(["Blank", "Asis"])
     assert len(obj) == 2
Example #18
0
 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")
Example #19
0
 def shouldAddCellHandlersToList(self):
     obj = CellHandlers()
     obj.addHandler(CellHandler("Blank"))
     obj.addHandler(CellHandler("Asis"))
     assert len(obj) == 2