def test_selectBelow_onlyOnePoint(): """ Selecting below some threshold should only result the correct lowest point. """ pc_in = get_test_data() pc_out = select_below(pc_in, 'z', 3.2) assert_equal(len(pc_out[point]['x']['data']), 1) assert_almost_equal(pc_out[point]['x']['data'][0], 1.1) assert_almost_equal(pc_out[point]['y']['data'][0], 2.1) assert_almost_equal(pc_out[point]['z']['data'][0], 3.1) assert_almost_equal(pc_out[point]['return']['data'][0], 1)
def select_below_ridiculous_high_z(pc_in): return select_below(pc_in, 'z', 100000)
def test_selectBelow_outputIsNotInput(): """ Select change output, make sure that input hasn't changed. """ pc_in = get_test_data() pc_out = select_below(pc_in, 'z', 3.2) pc_out['points']['x']['data'][0] += 1 assert_points_equal(pc_in, get_test_data())