Added test for 'overwrite' flag of putAttachement
Minor test refactoring