def test_extend_upward(r_plot, end): r_plot = np.array(r_plot) ratio = r_plot[:-1] / r_plot[1:] steep_upward = ratio <= .9 downward = ratio > 1 e = _extend_region(steep_upward, downward, 0, 2) assert e == end