def test00_missingConfigFileGivenOnCLI(self): does_not_exist_file = os.path.join(self.tmpdir, "thisdoesnotexist.xml") try: makeApplication([does_not_exist_file]) self.fail("previous line should have thrown exception") except: pass
def test00_missingConfigFileGivenOnCLI(self): doesNotExistFile = os.path.join(self.tmpdir, "thisdoesnotexist.xml") caughtIt = False try: makeApplication([doesNotExistFile]) self.fail("previous line should have thrown exception") except exceptions.SystemExit, e: self.assertEquals(e.__str__(), "1") caughtIt = True
def test01_missingConfigFileGivenOnCLI_sysVersionDitched(self): _v = sys.version sys.version = 'BMK' does_not_exist_file = os.path.join(self.tmpdir, "thisdoesnotexist.xml") try: makeApplication([does_not_exist_file]) self.fail("previous line should have thrown exception") except: pass finally: sys.version = _v
def test01_missingConfigFileGivenOnCLI_sysVersionDitched(self): doesNotExistFile = os.path.join(self.tmpdir, "doesnotexists.xml") saveSysVersion = sys.version sys.version = "BMK" caughtIt = False try: makeApplication([doesNotExistFile]) self.fail("previous line should have thrown exception") except exceptions.SystemExit, e: self.assertEquals(e.__str__(), "1") caughtIt = True
def test02_validConfig(self): configFile = os.path.join(self.tmpdir, "ourconfig.xml") configFH = open(configFile, "w") configFH.write(settings_xml_server_open_options % { 'listen_options': '', 'additional_path': ''}) configFH.close() application = makeApplication([configFile]) from twisted.python.components import Componentized self.failUnless(isinstance(application, Componentized))
def test02_validConfig(self): configFile = os.path.join(self.tmpdir, "ourconfig.xml") configFH = open(configFile, "w") configFH.write(settings_xml_server_open_options %\ { 'listen_options' : '', 'additional_path' : '', 'script_dir': SCRIPT_DIR}) configFH.close() application = makeApplication([configFile]) from twisted.python.components import Componentized self.failUnless(isinstance(application, Componentized))