def test_division(self): self.assertAlmostEqual(23.976, prass.parse_fps_string("24000/1001"), places=3) self.assertAlmostEqual(29.970, prass.parse_fps_string("30000/1001"), places=3)
def test_number(self): self.assertEqual(23.976, prass.parse_fps_string("23.976")) self.assertEqual(24, prass.parse_fps_string("24"))
def test_invalid(self): self.assertRaises(common.PrassError, lambda: prass.parse_fps_string("24000/1001/1")) self.assertRaises(common.PrassError, lambda: prass.parse_fps_string("not a number"))