add some basic tests.  fix uncovered bug of empty policies directory