Test case for write_json file