fix write_file test; add METRIQUE_MONGODB env var batck to __init__