def test_write_file(self):
    with open(self.input_file_path) as bibtex_file:
        bibtex_database = bibdeskparser.load(bibtex_file)
    with TemporaryFile(mode='w+') as bibtex_out_file:
        bibdeskparser.dump(bibtex_database, bibtex_out_file)
        bibtex_out_file.seek(0)
        bibtex_out_str = bibtex_out_file.read()
    self.assertEqual(bibtex_out_str, self.expected)
def test_write_file(self):
    with open(self.input_file_path) as bibtex_file:
        bibtex_database = bibdeskparser.load(bibtex_file)
    with TemporaryFile(mode='w+') as bibtex_out_file:
        bibdeskparser.dump(bibtex_database, bibtex_out_file)
        bibtex_out_file.seek(0)
        bibtex_out_str = bibtex_out_file.read()
    self.assertEqual(bibtex_out_str, self.expected)