* fix: autoxml based write routine for SpecFile

* fix: use context dammit!
This commit is contained in:
Eray Özkural
2005-10-31 17:34:20 +00:00
parent db8b20569b
commit 3bfc029ef6
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -268,8 +268,9 @@ class SpecFile(XmlFile):
def write(self, filename):
"""Write PSPEC file"""
errs = []
self.newDOM()
self.addChild(self.source.elt(self))
for pkg in self.packages:
self.addChild(pkg.elt(self))
self.encode(self, self.rootNode(), errs)
if errs:
raise Error(*errs)
self.writexml(filename)
+1 -1
View File
@@ -78,6 +78,6 @@ class SpecFileNewTestCase(testcase.TestCase):
def testCopy(self):
util.check_dir(ctx.config.tmp_dir())
self.spec.read("tests/popt/pspec.xml")
self.spec.write(os.path.join(config.tmp_dir(), 'popt-copy.pspec.xml'))
self.spec.write(os.path.join(ctx.config.tmp_dir(), 'popt-copy.pspec.xml'))
suite = unittest.makeSuite(SpecFileNewTestCase)