def test_dump(self): props = OrderedDict() props["a"] = 1 props["b"] = "2\n" props["c"] = " 3 : =" out = StringIO() Properties.dump(props, out) self.assertEqual("a=1\nb=2\\\n\nc=\\ 3\\ \\:\\ \\=\n", out.getvalue())
def test_dump(self): props = OrderedDict() props['a'] = 1 props['b'] = '''2 ''' props['c'] =' 3 : =' out = StringIO() Properties.dump(props, out) self.assertEqual('a=1\nb=2\\\n\nc=\\ 3\\ \\:\\ \\=\n', out.getvalue())
def dump(self, path): """Saves the pushdb as a properties file to the given path.""" with open(path, 'w') as props: Properties.dump(self._props, props)