def test_invalid_string(self): with self.assertRaises(ValueError): saturation('lol')
def test_valid_float_cut(self): self.assertEqual(saturation(2.9), 2)
def test_invalid_max(self): with self.assertRaises(ValueError): saturation(255)
def test_valid_max_string(self): self.assertEqual(saturation('254'), 254)
def test_valid_min_string(self): self.assertEqual(saturation('0'), 0)
def test_valid_max(self): self.assertEqual(saturation(254), 254)
def test_valid_normal(self): self.assertEqual(saturation(100), 100)
def test_valid_min(self): self.assertEqual(saturation(0), 0)