def test_getColorByName_NullColorName_GetsBlackHex(self): """ Passes in a null color name, gets black back """ hex = views.getColorByName(None) self.assertEqual("#000000", hex)
def test_getColorByName_InvalidColorName_GetsBlackHex(self): """ Passes in a nonsense color name, gets black as a default back """ hex = views.getColorByName("The Colour of Magic") self.assertEqual("#000000", hex)
def test_getColorByName_AnyCaseName_GetsHexValue(self): """ Pass in a color name in a jumbled case, returns hex value """ hex = views.getColorByName("DArkMaGeNta") self.assertEqual("#8b008b", hex)
def test_getColorByName_MultipleWordsColorName_GetsHexValue(self): """ Passes in a multi-word color, with spaces, gets a hex value back """ hex = views.getColorByName("Light Slate Gray") self.assertEqual("#778899", hex)
def test_getColorByName_CssColorName_GetsHexValue(self): """ Pass in a color name, get a hex value back """ hex = views.getColorByName("red") self.assertEqual("#ff0000", hex)