Ejemplo n.º 1
0
 def test_add_with_comments(self):
     w1 = Wax(a=1)
     w1._add_comment('foo\nbar')
     w1.b = 'a string'
     w1._add_comment('abc\ndef\nghi')
     self.assertEquals(w1.keys(), ['a', 'b'])
     w2 = Wax()
     w2 += w1
     self.assertEquals(w2._comments[0], 'foo\nbar')
     out = str(w2)
     self.assertTrue('# foo\n# bar\n' in out)
Ejemplo n.º 2
0
 def test_add_with_comments(self):
     w1 = Wax(a=1)
     w1._add_comment('foo\nbar')
     w1.b = 'a string'
     w1._add_comment('abc\ndef\nghi')
     self.assertEquals(w1.keys(), ['a', 'b'])
     w2 = Wax()
     w2 += w1
     self.assertEquals(w2._comments[0], 'foo\nbar')
     out = str(w2)
     self.assertTrue('# foo\n# bar\n' in out)