예제 #1
0
 def test_invalid_negativ(self):
     with self.assertRaises(ValueError):
         brightness(-1)
예제 #2
0
 def test_invalid_string(self):
     with self.assertRaises(ValueError):
         brightness('lol')
예제 #3
0
 def test_valid_float_cut(self):
     self.assertEqual(brightness(2.9), 2)
예제 #4
0
 def test_invalid_max(self):
     with self.assertRaises(ValueError):
         brightness(255)
예제 #5
0
 def test_valid_max_string(self):
     self.assertEqual(brightness('254'), 254)
예제 #6
0
 def test_valid_min_string(self):
     self.assertEqual(brightness('1'), 1)
예제 #7
0
 def test_valid_max(self):
     self.assertEqual(brightness(254), 254)
예제 #8
0
 def test_valid_normal(self):
     self.assertEqual(brightness(100), 100)
예제 #9
0
 def test_valid_min(self):
     self.assertEqual(brightness(1), 1)