fix tests for PortageModulesFile
authorAlec Warner <antarus@gentoo.org>
Mon, 26 Mar 2007 05:28:04 +0000 (05:28 -0000)
committerAlec Warner <antarus@gentoo.org>
Mon, 26 Mar 2007 05:28:04 +0000 (05:28 -0000)
svn path=/main/trunk/; revision=6289

pym/portage/tests/env/config/test_PortageModulesFile.py

index 4d1b481e2d5a70f9ae6bd49ed151ae4d2b39d39d..b523cbe7bf370ca32ca55f4b20fb9c252e9197b1 100644 (file)
@@ -3,6 +3,7 @@ import os
 from portage.tests import TestCase
 from portage.env.config import PortageModulesFile
 from tempfile import mkstemp
+from itertools import izip
 
 class PortageModulesFileTestCase(TestCase):
 
@@ -10,7 +11,8 @@ class PortageModulesFileTestCase(TestCase):
        modules = ['spanky','zmedico','antarus','ricer']
 
        def setUp(self):
-               for k,v in (self.keys, self.modules):
+               self.items = {}
+               for k,v in izip(self.keys, self.modules):
                        self.items[k] = v
 
        def testPortageModulesFile(self):
@@ -21,9 +23,10 @@ class PortageModulesFileTestCase(TestCase):
                self.NukeFile()
 
        def BuildFile(self):
-               fd,self.fname = mkstemp()
-               f = os.fdopen(self.fname, 'wb')
-               f.write('%s %s\n' % (self.cpv, ' '.join(self.keywords)))
+               fd, self.fname = mkstemp()
+               f = os.fdopen(fd, 'wb')
+               for k,v in self.items.iteritems():
+                       f.write('%s=%s\n' % (k,v))
                f.close()
 
        def NukeFile(self):