testcases for DatabaeCursor and write_json