Exemplo n.º 1
0
 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())
Exemplo n.º 2
0
 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())
Exemplo n.º 3
0
 def test_write_to_file_empty(self):
     c = ConfigFile()
     f = BytesIO()
     c.write_to_file(f)
     self.assertEqual(b"", f.getvalue())