refactor test_category_add_with_file