def test_write_to_file_section(self): c = ConfigFile() c.set(("core", ), "foo", "bar") f = BytesIO() c.write_to_file(f) self.assertEqual(b"[core]\n\tfoo = bar\n", f.getvalue())
def test_write_to_file_subsection(self): c = ConfigFile() c.set(("branch", "blie"), "foo", "bar") f = BytesIO() c.write_to_file(f) self.assertEqual(b"[branch \"blie\"]\n\tfoo = bar\n", f.getvalue())
def test_write_to_file_empty(self): c = ConfigFile() f = BytesIO() c.write_to_file(f) self.assertEqual(b"", f.getvalue())