def test_default(self): self.assertEqual(0.0, _percent(1, 0)) self.assertEqual(0.0, _percent(0, 0)) self.assertEqual(None, _percent(0, 0, default=None))
def test_basic(self): self.assertEqual(62.5, _percent(5, 8))