* fix: autoxml based write routine for SpecFile
* fix: use context dammit!
This commit is contained in:
+4
-3
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user