def check_07(self): """ Check passing background Colour to new ColourManager """ newManager = colourmanager.ColourManager(self.exampleColour) assert newManager.background == self.exampleColourTuple assert newManager.removedValues == [self.exampleColourTuple]
def check_05(self): """ Check that new ColourManager has a list of removed values and that it's empty """ newManager = colourmanager.ColourManager() assert hasattr(newManager, 'removedValues') assert newManager.removedValues == []
def check_06(self): """ Check passing background tuple to new ColourManager """ newManager = colourmanager.ColourManager(self.exampleColourTuple) assert hasattr(newManager, 'background') assert newManager.background == self.exampleColourTuple assert newManager.removedValues == [self.exampleColourTuple]
def setUp(self): """ Create an example ColourManager() and Colour() to use in the tests """ self.manager = colourmanager.ColourManager() self.exampleColourTuple = [190, 200, 192] self.exampleColourName = 'Ecstatic Green' self.exampleColour = colourmanager.Colour(self.manager, self.exampleColourName, self.exampleColourTuple)
def check_08(self): """ Check that we can call for ten new colours one at a time with a new manager, checking that each one is different and belongs to the class Colour() and that the manager adds the rgb tuple of each one to its list of removedValues """ newManager = colourmanager.ColourManager(self.exampleColour) extractedColours = [newManager.nextColour() for i in range(0, 10)] for entry in extractedColours: assert extractedColours.count(entry) == 1 assert isinstance(entry, colourmanager.Colour) assert entry.colourvalues in newManager.removedValues
def check_09(self): """ Check that we can call for a list of ten colours (all at once) using the colourList method with a new manager, checking that each one is different and belongs to the class Colour() and that the manager adds the rgb tuple of each one to its list of removedValues """ newManager = colourmanager.ColourManager(self.exampleColour) extractedColours = newManager.colourList(10) assert isinstance(extractedColours, list) assert len(extractedColours) == 10 for entry in extractedColours: assert extractedColours.count(entry) == 1 assert isinstance(entry, colourmanager.Colour) assert entry.colourvalues in newManager.removedValues