Added unittest for build_index