def testCookieSecret(self): cfg = Config() cfg.add_section("cookies") cfg.set('cookies', 'secret', "ULTRA SECRET") self.assertEquals("ULTRA SECRET", cfg.getcookiesecret()) del cfg cfg = Config() secret = cfg.getcookiesecret() self.assertEquals(secret, cfg.getcookiesecret()) del cfg cfg = Config() self.assertFalse(secret == cfg.getcookiesecret())
def testNetworkParams(self): cfg = Config() self.assertEquals("0.0.0.0", cfg.gethost()) self.assertEquals(3333, cfg.getport()) del cfg cfg = Config() cfg.set("web", "randomport", "True") port = cfg.getport() self.assertEquals(port, cfg.getport()) del cfg cfg = Config() cfg.set("web", "randomport", "True") self.assertFalse(port == cfg.getport())
def _testConfig(self): cfg = Config() cfg.set("pycsc", "ATR", "3B 00") cfg.set("pycsc", "applets", "testapplet") appletfile = os.path.join(os.path.dirname(os.path.abspath(__file__)), "testapplet.py") cfg.set("pycsc", "testapplet", appletfile) return cfg
def _testConfig(self): cfg = Config() cfg.set("pycsc", "ATR", "3B 00") appletfile = os.path.join(os.path.dirname(os.path.abspath(__file__)), "javatest.cap") cfg.set("pycsc", "capfile", appletfile) return cfg