def testIncludeConfigFileFails(self):
        class TestCfgFile(ConfigFile):
            bam = CfgBool

        dir = tempfile.mkdtemp()
        try:
            open('%s/foo' % dir, 'w').write('inCLUDEconFIGFile http://nonesuchrediculoushostexists//bar\n')
            cfg = TestCfgFile()
            assert(not cfg.bam)
            try:
                cfg.read('%s/foo' % dir)
                assert(0)
            except Exception, e:
                if 'failure in name resolution' in str(e):
                    raise testhelp.SkipTestException('requires default route')
                desc, sep, err = str(e).partition('bar: ')
                self.assertEqual(desc, "%s/foo:1: when processing "
                    "inCLUDEconFIGFile: Error reading config file "
                    "http://nonesuchrediculoushostexists//" %dir)
                self.assertIn(err, [
                    "Name or service not known",
                    "No address associated with hostname"])

            cfg = TestCfgFile()
            cfg.ignoreUrlIncludes()
            cfg.read('%s/foo' % dir)
            cfg = TestCfgFile()
            cfg.ignoreUrlIncludes()
            cfg.ignoreUrlIncludes(False)
            self.assertRaises(Exception, cfg.read,'%s/foo' % dir)
            cfg = TestCfgFile()
            cfg.setIgnoreErrors()
            cfg.read(dir % '%s/foo')
        finally:
            shutil.rmtree(dir)
dataset/ETHPy150Open sassoftware/conary/conary_test/libtest/cfgtest.py/ConfigTest.testIncludeConfigFileFails/swapped operands of `%`