def test_time_steps_for_nfrs_refcnt(self): # sys.getrefcnt is generally one higher than expected ts = time_steps_for_nfrs(1) self.assertEqual(sys.getrefcount(ts), 1 + 1) self.assertEqual(sys.getrefcount(ts[0]), 1 + 1)
def test_time_steps_for_nfrs_refcnt(self): # sys.getrefcnt is generally one higher than expected ts = time_steps_for_nfrs(1) self.assertEqual(sys.getrefcount(ts), 1+1) self.assertEqual(sys.getrefcount(ts[0]), 1+1)
def test_time_steps_for_nfrs(self): self.assertSequenceEqual(time_steps_for_nfrs(0), []) self.assertSequenceEqual(time_steps_for_nfrs(1), [0.5]) self.assertSequenceEqual(time_steps_for_nfrs(2), [1 / 3.0, 2 / 3.0]) self.assertSequenceEqual(time_steps_for_nfrs(3), [0.25, 0.5, 0.75])
def test_time_steps_for_nfrs(self): self.assertSequenceEqual(time_steps_for_nfrs(0),[]) self.assertSequenceEqual(time_steps_for_nfrs(1),[0.5]) self.assertSequenceEqual(time_steps_for_nfrs(2),[1/3.0, 2/3.0]) self.assertSequenceEqual(time_steps_for_nfrs(3),[0.25, 0.5, 0.75])