Fix write graph test (bad_dir is not a function)