We can definitely write API tests for this (by adding to lib/galaxy_test/api/test_histories.py ), I can help with that.
You can check the tests in that file locally with ./run_tests.sh -api lib/galaxy_test/api/test_histories.py
(this is the path in the dev branch of the galaxy repo, for release_19.09 and older the file is in test/api/ )
Nicola Soranzo Dec 06 12:27 TechnicalSteeringCommittee
Hadley King Dec 06 12:31