def testMsiArgs(self):
        def mockBuildMSI(version, msiArgs=None):
            def do(a, macros):
                a.package = a.package % macros
                msiPath = os.path.join(self.archivePath, 'Setup2.msi')
                a.recipe._addCapsule(msiPath, 'msi', a.package % macros)
                a.recipe.winHelper = source.WindowsHelper()
                a.recipe.winHelper.productName = 'WindowsAppTest'
                a.recipe.winHelper.platform = ''
                a.recipe.winHelper.version = version
                a.recipe.winHelper.productCode = 'foo'
                a.recipe.winHelper.upgradeCode = 'bar'
                a.recipe.winHelper.msiArgs = msiArgs

            self.mock(build.BuildMSI, 'do', do)


        repos = self.openRepository()
        origDir = os.getcwd()

        self.resetWork()
        os.chdir(self.workDir)

        self.newpkg('WindowsAppTest')
        os.chdir('WindowsAppTest')
        self.writeFile('WindowsAppTest.recipe', self.test_recipe3)
        self.addfile('WindowsAppTest.recipe')
        self.commit()

        os.chdir(origDir)
        self.resetWork()
        os.chdir(self.workDir)

        mockBuildMSI('1.2.3.4', '/q /l*v /i')
        built, _ = self.cookItem(repos, self.cfg, 'WindowsAppTest')

        msis = [ x for x in built if x[0].endswith(':msi') ]
        self.assertEqual(len(msis), 1)

        msi = msis[0]

        repos = self.openRepository()
        spec = repos.findTrove(self.cfg.buildLabel, msi)
        self.assertEqual(len(spec), 1)

        trv = repos.getTrove(*spec[0])

        self.assertEqual(trv.troveInfo.capsule.msi.name(), 'WindowsAppTest')
        self.assertEqual(trv.troveInfo.capsule.msi.platform(), '')
        self.assertEqual(trv.troveInfo.capsule.msi.version(), '1.2.3.4')
        self.assertEqual(trv.troveInfo.capsule.msi.productCode(), 'foo')
        self.assertEqual(trv.troveInfo.capsule.msi.upgradeCode(), 'bar')
        self.assertEqual(trv.troveInfo.capsule.msi.msiArgs(), '/q /l*v /i')
dataset/ETHPy150Open sassoftware/conary/conary_test/cvctest/buildtest/windowsactiontest.py/WindowsActionTest.testMsiArgs/original