예제 #1
0
 def test_bad_string(self):
     with self.assertRaises(ArgumentTypeError):
         float_fraction('a')
예제 #2
0
 def test_one_ok(self):
     self.assertEqual(1, float_fraction('1'))
예제 #3
0
 def test_float_negative_error(self):
     with self.assertRaises(ArgumentTypeError):
         float_fraction('-0.1')
예제 #4
0
 def test_zero_ok(self):
     self.assertEqual(0, float_fraction('0'))
예제 #5
0
 def test_float_too_big(self):
     with self.assertRaises(ArgumentTypeError):
         float_fraction('1.1')