def testCookWithMSICapsule(self):
        recipestr = """
class TestCookWithMSICapsule(CapsuleRecipe):
    name = '%s'
    version = '%s'

    clearBuildReqs()

    def setup(r):
        r.addCapsule(%s)

"""
        pkgName = 'foo'
        version = '1.3.5.7abc'
        msiName = 'Setup2.msi'
        addCapsuleArgs = msiName % '\'%s\', msiArgs=\'/q /l*v /i\''
        recipestr = recipestr % (pkgName, version, addCapsuleArgs)
        self.cfg.windowsBuildService = '172.16.175.244'

        class fakeWinHelper:
            name = 'foo'
            productName = 'A Super Wonderful MSI'
            version = '1.2.3.4'
            platform = 'ia64'
            productCode = 'pcode'
            upgradeCode = 'ucode'
            msiArgs = None
            components = []
            def __init__(self,*args):
                pass
            def extractMSIInfo(self, *args, **kwargs):
                pass

        from conary.build import source
        self.mock(source, 'WindowsHelper', fakeWinHelper)

        pkgNames, built, cs = self._cookPkgs(recipestr, msiName, pkgName)

        ti = [ tcs.getTroveInfo() for tcs in cs.iterNewTroveList()
               if tcs.name() == 'foo:msi'][0]
        self.assertEqual(ti.capsule.msi.name(),
                             fakeWinHelper.productName)
        self.assertEqual(ti.capsule.msi.version(),
                             fakeWinHelper.version)
        self.assertEqual(ti.capsule.msi.platform(),
                             fakeWinHelper.platform)
        self.assertEqual(ti.capsule.msi.productCode(),
                             fakeWinHelper.productCode)
        self.assertEqual(ti.capsule.msi.upgradeCode(),
                             fakeWinHelper.upgradeCode)
        self.assertEqual(ti.capsule.msi.msiArgs(),
                             '/q /l*v /i')

        self.assertEquals(pkgNames, [pkgName, pkgName +':msi'])
dataset/ETHPy150Open sassoftware/conary/conary_test/cvctest/buildtest/cookmsicapsuletest.py/CookTestWithMSICapsules.testCookWithMSICapsule/swapped operands of `%`