Exemplo n.º 1
0
 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())
Exemplo n.º 2
0
  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())
Exemplo n.º 3
0
  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())
Exemplo n.º 4
0
 def assertLoaded(self, contents, expected):
   self.assertEqual(expected, Properties.load(contents))
Exemplo n.º 5
0
 def load(path):
   """Loads a pushdb maintained in a properties file at the given path."""
   with open(path, 'r') as props:
     properties = Properties.load(props)
     return PushDb(properties)
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
 def assertLoaded(self, contents, expected):
     self.assertEqual(expected, Properties.load(contents))
Exemplo n.º 8
0
 def load(path):
   """Loads a pushdb maintained in a properties file at the given path."""
   with open(path, 'r') as props:
     properties = Properties.load(props)
     return PushDb(properties)
Exemplo n.º 9
0
 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)