Move test codes to package tests