def test_finegrid(): fine_drf = np.ones(10) fine_drc = np.ones(11) drf_finer, mapindex, mapfact, cellindex = fine(np.squeeze(fine_drf), np.squeeze(fine_drc), fine_drf.size, 10) assert (drf_finer[0]) == np.float32(0.1)
def test_no_trespassing(self): a = [30, 50, 70, 90, 120] ans = _( "The speed fine for a speed of {} instead of {} is {} and you returned {}." ) for i in range(len(a)): b = a[i] - random.randint(0, 1) stu_ans = fine.fine(a[i], b) corr_ans = corr.fine(a[i], b) self.assertEqual( corr_ans, stu_ans, ans.format(str(b), str(a[i]), str(corr_ans), str(stu_ans)))