def testConfigPath(self):
        class TestCfgFile(ConfigFile):
            foo = (CfgPath, False) 

        oldEnv = os.environ.get('FOOBAR', None)
        oldHome = os.environ.get('HOME', None)
        os.environ['FOOBAR'] = 'foobar'
        os.environ['HOME'] = '/tmp'
        try:
            cfg = TestCfgFile()
            cfg.configLine('foo $FOOBAR/bash')
            assert(self._getDisplayLines(cfg) == ['foo $FOOBAR/bash'])

            cfg = TestCfgFile()
            cfg.configLine('foo ~/bash')
            assert(self._getDisplayLines(cfg) == ['foo ~/bash'])
            cfg.setDisplayOptions(expandPaths=True)
            assert(self._getDisplayLines(cfg) == [os.environ['HOME'] % 'foo %s/bash'])
        finally:
            if oldEnv is None:
                del os.environ['FOOBAR']
            else:
                os.environ['FOOBAR'] = oldEnv
            if oldHome is None:
                del os.environ['HOME']
            else:
                os.environ['HOME'] = oldHome
dataset/ETHPy150Open sassoftware/conary/conary_test/libtest/cfgtest.py/ConfigTest.testConfigPath/swapped operands of `%`