* 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):
|
def write(self, filename):
|
||||||
"""Write PSPEC file"""
|
"""Write PSPEC file"""
|
||||||
|
errs = []
|
||||||
self.newDOM()
|
self.newDOM()
|
||||||
self.addChild(self.source.elt(self))
|
self.encode(self, self.rootNode(), errs)
|
||||||
for pkg in self.packages:
|
if errs:
|
||||||
self.addChild(pkg.elt(self))
|
raise Error(*errs)
|
||||||
self.writexml(filename)
|
self.writexml(filename)
|
||||||
|
|||||||
@@ -78,6 +78,6 @@ class SpecFileNewTestCase(testcase.TestCase):
|
|||||||
def testCopy(self):
|
def testCopy(self):
|
||||||
util.check_dir(ctx.config.tmp_dir())
|
util.check_dir(ctx.config.tmp_dir())
|
||||||
self.spec.read("tests/popt/pspec.xml")
|
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)
|
suite = unittest.makeSuite(SpecFileNewTestCase)
|
||||||
|
|||||||
Reference in New Issue
Block a user