def test_filename(self): figs.dump(self.conf, self.target_filename) with open(self.target_filename) as f: self.assertEqual(f.read(), self.conf_content)
def test_file(self): sio = StringIO() figs.dump(self.conf, sio) self.assertEqual(sio.getvalue(), self.conf_content) self.assertFalse(sio.closed)
def test_section_filename(self): figs.dump(self.conf.default, self.target_filename) with open(self.target_filename) as f: self.assertEqual(f.read(), self.conf_content.split(None, 1)[-1])